Skip to content

Commit

Permalink
Release version 1.38.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyorbin committed Aug 25, 2022
1 parent a0c724c commit d716b66
Show file tree
Hide file tree
Showing 22 changed files with 3,317 additions and 2,518 deletions.
22 changes: 22 additions & 0 deletions AppboyProject/AppboyProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class AppboyProject extends Component {
this._hideCurrentInAppMessage = this._hideCurrentInAppMessage.bind(this);
this._setAttributionData = this._setAttributionData.bind(this);
this._getContentCards = this._getContentCards.bind(this);
this._requestPushPermission = this._requestPushPermission.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -107,6 +108,12 @@ class AppboyProject extends Component {
Braze.addListener(Braze.Events.SDK_AUTHENTICATION_ERROR, function(data) {
console.log(`SDK Authentication for ${data.user_id} failed with error code ${data.error_code}.`);
});

Braze.addListener(Braze.Events.PUSH_NOTIFICATION_EVENT, function(data) {
console.log(`Push Notification event of type ${data.push_event_type} seen.
Title ${data.title}\n and deeplink ${data.deeplink}`);
console.log(JSON.stringify(data, undefined, 2));
});
}

componentWillUnmount() {
Expand Down Expand Up @@ -328,6 +335,10 @@ class AppboyProject extends Component {
onPress={this._getContentCards}>
<Text>Request Cached Content Cards</Text>
</TouchableHighlight>
<TouchableHighlight
onPress={this._requestPushPermission}>
<Text>Request Push Permission</Text>
</TouchableHighlight>
</ScrollView>
);
}
Expand Down Expand Up @@ -608,6 +619,17 @@ class AppboyProject extends Component {
console.log("Content Cards Promise Rejected");
});
}

_requestPushPermission(event) {
const options = {
"alert": true,
"badge": true,
"sound": true,
"provisional": false
};

Braze.requestPushPermission(options);
}
}

const styles = StyleSheet.create({
Expand Down
6 changes: 3 additions & 3 deletions AppboyProject/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
compileSdkVersion 33
buildToolsVersion "33.0.0"

defaultConfig {
applicationId "com.appboyproject"
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
versionCode 1
versionName "1.0"
ndk {
Expand Down
5 changes: 3 additions & 2 deletions AppboyProject/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.6.0'

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "com.google.gms:google-services:4.3.4"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand Down
Loading

0 comments on commit d716b66

Please sign in to comment.