react-native-mapp-plugin 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/Mapp-Engage-ReactNative-Plugin.iml +9 -0
- package/.idea/caches/deviceStreaming.xml +787 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.vscode/settings.json +2 -1
- package/CHANGELOG.md +9 -0
- package/Helper.md +23 -0
- package/Mapp.js +26 -0
- package/RNMappPlugin.podspec +2 -2
- package/__package.json +2 -2
- package/android/.project +1 -1
- package/android/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/android/build.gradle +26 -55
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +36 -8
- package/android/settings.gradle +24 -1
- package/android/src/main/AndroidManifest.xml +5 -6
- package/android/src/main/java/com/reactlibrary/MessageService.java +16 -10
- package/android/src/main/java/com/reactlibrary/RNMappPluginModule.java +91 -12
- package/android/src/main/java/com/reactlibrary/RNMappPluginPackage.java +36 -19
- package/build/generated/ios/MappEngagePluginSpec/MappEngagePluginSpec-generated.mm +16 -0
- package/build/generated/ios/MappEngagePluginSpec/MappEngagePluginSpec.h +38 -0
- package/build/generated/ios/MappEngagePluginSpecJSI-generated.cpp +17 -0
- package/build/generated/ios/MappEngagePluginSpecJSI.h +19 -0
- package/build/generated/ios/RCTAppDependencyProvider.h +25 -0
- package/build/generated/ios/RCTAppDependencyProvider.mm +35 -0
- package/build/generated/ios/RCTModuleProviders.h +16 -0
- package/build/generated/ios/RCTModuleProviders.mm +51 -0
- package/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +54 -0
- package/build/generated/ios/RCTThirdPartyComponentsProvider.h +16 -0
- package/build/generated/ios/RCTThirdPartyComponentsProvider.mm +30 -0
- package/build/generated/ios/ReactAppDependencyProvider.podspec +34 -0
- package/clean.sh +34 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/Info.plist +48 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64/libAppoxeeLocationServices.a +0 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeLocationManager.h +122 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeLocationServices.h +11 -0
- package/ios/Frameworks/AppoxeeLocationServices.xcframework/ios-arm64_x86_64-simulator/libAppoxeeLocationServices.a +0 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/Info.plist +48 -0
- package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXClientDevice.h +1 -0
- package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotificationActionButtonAction.h +3 -2
- package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/Appoxee.h +39 -2
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64/libAppoxeeSDK.a +0 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXClientDevice.h +27 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXInterfaceService.h +49 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotification.h +92 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotificationAction.h +20 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotificationActionButton.h +19 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXPushNotificationActionButtonAction.h +36 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/APXRichMessage.h +58 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/Appoxee.h +877 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeManager.h +386 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/Headers/AppoxeeSDK.h +12 -0
- package/ios/Frameworks/AppoxeeSDK.xcframework/ios-arm64_x86_64-simulator/libAppoxeeSDK.a +0 -0
- package/ios/RNMappPluginModule.m +33 -0
- package/package.json +13 -6
- package/react-native.config.js +7 -0
- package/specs/MappEngagePluginSpec.js +8 -0
- package/ios/Frameworks/AppoxeeLocationServices.framework/Versions/A/AppoxeeLocationServices +0 -0
- package/ios/Frameworks/AppoxeeSDK.framework/Versions/A/AppoxeeSDK +0 -0
- /package/ios/Frameworks/{AppoxeeLocationServices.framework/Versions/A → AppoxeeLocationServices.xcframework/ios-arm64}/Headers/AppoxeeLocationManager.h +0 -0
- /package/ios/Frameworks/{AppoxeeLocationServices.framework/Versions/A → AppoxeeLocationServices.xcframework/ios-arm64}/Headers/AppoxeeLocationServices.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXInterfaceService.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotification.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotificationAction.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXPushNotificationActionButton.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/APXRichMessage.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/AppoxeeManager.h +0 -0
- /package/ios/Frameworks/{AppoxeeSDK.framework/Versions/A → AppoxeeSDK.xcframework/ios-arm64}/Headers/AppoxeeSDK.h +0 -0
package/.idea/misc.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/Mapp-Engage-ReactNative-Plugin.iml" filepath="$PROJECT_DIR$/.idea/Mapp-Engage-ReactNative-Plugin.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Version 1.4.0
|
|
2
|
+
- Updated react native version to 0.81.4
|
|
3
|
+
- Updated Gradle to version 8.14.2
|
|
4
|
+
- android minSdk updated to version 24
|
|
5
|
+
- android targetSdk updated to version 36
|
|
6
|
+
|
|
7
|
+
### Android requrements
|
|
8
|
+
* minimum required node version is 20.19.4
|
|
9
|
+
* minimum requred Gradle version 8.14.2
|
package/Helper.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
### Clean all caches
|
|
2
|
+
```bash
|
|
3
|
+
./clean.sh
|
|
4
|
+
```
|
|
5
|
+
|
|
6
|
+
### Generate codegen
|
|
7
|
+
```bash
|
|
8
|
+
npx react-native codegen
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### rebuild node_modules
|
|
12
|
+
```bash
|
|
13
|
+
npm install #or yarn install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Run application
|
|
17
|
+
```bash
|
|
18
|
+
npx react-native run-android
|
|
19
|
+
```
|
|
20
|
+
or
|
|
21
|
+
```bash
|
|
22
|
+
npx react-native run-ios
|
|
23
|
+
```
|
package/Mapp.js
CHANGED
|
@@ -91,6 +91,16 @@ export class Mapp {
|
|
|
91
91
|
return RNMappPluginModule.setAlias(alias);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Sets user alias
|
|
96
|
+
*
|
|
97
|
+
* @param alias
|
|
98
|
+
* @param resendAttributes
|
|
99
|
+
*/
|
|
100
|
+
static setAlias(alias: string, resendAttributes: bool): Promise<Boolean> {
|
|
101
|
+
return RNMappPluginModule.setAliasWithResend(alias, resendAttributes);
|
|
102
|
+
}
|
|
103
|
+
|
|
94
104
|
/**
|
|
95
105
|
* getAlias
|
|
96
106
|
*
|
|
@@ -205,6 +215,22 @@ export class Mapp {
|
|
|
205
215
|
}
|
|
206
216
|
}
|
|
207
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Set Custom Attributes
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
222
|
+
static setAttributes(attributes: object) {
|
|
223
|
+
return RNMappPluginModule.setAttributes(attributes);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get Custom Attributes
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
static getAttributes(attributes: array): Promise<Object> {
|
|
231
|
+
return RNMappPluginModule.getAttributes(attributes);
|
|
232
|
+
}
|
|
233
|
+
|
|
208
234
|
/**
|
|
209
235
|
* Set Custom Attribute
|
|
210
236
|
*
|
package/RNMappPlugin.podspec
CHANGED
|
@@ -24,9 +24,9 @@ Pod::Spec.new do |s|
|
|
|
24
24
|
s.frameworks = "WebKit"
|
|
25
25
|
s.library = 'sqlite3'
|
|
26
26
|
s.dependency "React"
|
|
27
|
-
s.dependency "MappSDK" , '~> 6.0
|
|
27
|
+
s.dependency "MappSDK" , '~> 6.1.0'
|
|
28
28
|
s.dependency "MappSDKInapp"
|
|
29
|
-
s.dependency "MappSDKGeotargeting"
|
|
29
|
+
s.dependency "MappSDKGeotargeting", '~> 6.0.7'
|
|
30
30
|
|
|
31
31
|
end
|
|
32
32
|
|
package/__package.json
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"author": "Mapp",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"react": "^
|
|
17
|
+
"react": "^19.0.0",
|
|
18
18
|
"react-native": ">=0.60.0-rc.0 <1.0.x"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"jest": "^24.9.0",
|
|
22
|
-
"react": "^
|
|
22
|
+
"react": "^19.0.0",
|
|
23
23
|
"react-native": "^0.61.5"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
package/android/.project
CHANGED
|
@@ -5,7 +5,7 @@ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
|
|
5
5
|
connection.project.dir=
|
|
6
6
|
eclipse.preferences.version=1
|
|
7
7
|
gradle.user.home=
|
|
8
|
-
java.home=/Users/semsudin.tafilovic/
|
|
8
|
+
java.home=/Users/semsudin.tafilovic/.sdkman/candidates/java/11.0.26-tem
|
|
9
9
|
jvm.arguments=
|
|
10
10
|
offline.mode=false
|
|
11
11
|
override.workspace.settings=true
|
package/android/build.gradle
CHANGED
|
@@ -1,71 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
google()
|
|
7
|
-
mavenCentral()
|
|
8
|
-
maven {
|
|
9
|
-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
10
|
-
url "$rootDir/../node_modules/react-native/android"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
dependencies {
|
|
14
|
-
classpath('com.android.tools.build:gradle:8.2.2')
|
|
15
|
-
//classpath('com.google.gms:google-services:4.3.15')
|
|
16
|
-
//classpath("com.facebook.react:react-native-gradle-plugin")
|
|
17
|
-
// NOTE: Do not place your application dependencies here; they belong
|
|
18
|
-
// in the individual module build.gradle files
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
allprojects {
|
|
23
|
-
repositories {
|
|
24
|
-
google()
|
|
25
|
-
mavenLocal()
|
|
26
|
-
mavenCentral()
|
|
27
|
-
maven { url "https://maven.google.com/" }
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
apply plugin: 'com.android.library'
|
|
31
|
-
|
|
32
|
-
def safeExtGet(prop, fallback) {
|
|
33
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
1
|
+
plugins {
|
|
2
|
+
id("com.android.library")
|
|
3
|
+
id("org.jetbrains.kotlin.android")
|
|
4
|
+
id("com.facebook.react") // This is required for New Architecture & Codegen
|
|
34
5
|
}
|
|
35
6
|
|
|
36
7
|
android {
|
|
37
|
-
namespace
|
|
38
|
-
|
|
39
|
-
buildToolsVersion safeExtGet('buildToolsVersion', '34.0.0')
|
|
8
|
+
namespace "com.reactlibrary"
|
|
9
|
+
compileSdk = 36
|
|
40
10
|
|
|
41
11
|
defaultConfig {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
versionCode 1
|
|
45
|
-
versionName
|
|
12
|
+
minSdk = 24
|
|
13
|
+
targetSdk = 36
|
|
14
|
+
versionCode = 1
|
|
15
|
+
versionName = "1.0"
|
|
46
16
|
}
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
52
|
-
}
|
|
18
|
+
compileOptions {
|
|
19
|
+
sourceCompatibility = JavaVersion.VERSION_17
|
|
20
|
+
targetCompatibility = JavaVersion.VERSION_17
|
|
53
21
|
}
|
|
54
22
|
}
|
|
55
23
|
|
|
56
24
|
dependencies {
|
|
57
|
-
implementation
|
|
58
|
-
implementation
|
|
59
|
-
|
|
60
|
-
implementation 'androidx.appcompat:appcompat:1.7.
|
|
61
|
-
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.
|
|
62
|
-
implementation '
|
|
63
|
-
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
|
|
64
|
-
implementation platform('com.google.firebase:firebase-bom:33.6.0')
|
|
25
|
+
implementation "com.facebook.react:react-android:0.81.4"
|
|
26
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.2.20"
|
|
27
|
+
implementation 'com.google.code.gson:gson:2.13.2'
|
|
28
|
+
implementation 'androidx.appcompat:appcompat:1.7.1'
|
|
29
|
+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4'
|
|
30
|
+
implementation platform('com.google.firebase:firebase-bom:34.3.0')
|
|
65
31
|
implementation('com.google.firebase:firebase-messaging')
|
|
66
32
|
api('com.google.android.gms:play-services-location:21.3.0')
|
|
67
|
-
implementation 'androidx.media:media:1.7.
|
|
33
|
+
implementation 'androidx.media:media:1.7.1'
|
|
68
34
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
69
|
-
implementation("com.mapp.sdk:mapp-android:6.
|
|
35
|
+
implementation("com.mapp.sdk:mapp-android:6.1.2")
|
|
70
36
|
}
|
|
71
37
|
|
|
38
|
+
react {
|
|
39
|
+
jsRootDir = rootDir
|
|
40
|
+
libraryName = "RNMappPlugin"
|
|
41
|
+
codegenJavaPackageName = "com.reactlibrary"
|
|
42
|
+
}
|
|
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
|
|
3
3
|
distributionPath=wrapper/dists
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
6
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
|
|
7
7
|
android.enableAapt2=false
|
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
# Project-wide Gradle settings.
|
|
2
|
+
|
|
3
|
+
# IDE (e.g. Android Studio) users:
|
|
4
|
+
# Gradle settings configured through the IDE *will override*
|
|
5
|
+
# any settings specified in this file.
|
|
6
|
+
|
|
7
|
+
# For more details on how to configure your build environment visit
|
|
2
8
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
3
|
-
|
|
9
|
+
|
|
4
10
|
# Specifies the JVM arguments used for the daemon process.
|
|
5
11
|
# The setting is particularly useful for tweaking memory settings.
|
|
6
|
-
# Default value: -
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
|
13
|
+
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m
|
|
14
|
+
|
|
15
|
+
android.enableJetifier=true
|
|
9
16
|
# When configured, Gradle will run in incubating parallel mode.
|
|
10
17
|
# This option should only be used with decoupled projects. More details, visit
|
|
11
18
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
12
19
|
# org.gradle.parallel=true
|
|
13
|
-
|
|
20
|
+
|
|
21
|
+
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
22
|
+
# Android operating system, and which are packaged with your app's APK
|
|
23
|
+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
14
24
|
android.useAndroidX=true
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
|
|
26
|
+
# Use this property to specify which architecture you want to build.
|
|
27
|
+
# You can also override it from the CLI using
|
|
28
|
+
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
|
29
|
+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|
30
|
+
|
|
31
|
+
# Use this property to enable support to the new architecture.
|
|
32
|
+
# This will allow you to use TurboModules and the Fabric render in
|
|
33
|
+
# your application. You should enable this flag either if you want
|
|
34
|
+
# to write custom TurboModules/Fabric components OR use libraries that
|
|
35
|
+
# are providing them.
|
|
36
|
+
newArchEnabled=true
|
|
37
|
+
|
|
38
|
+
# Use this property to enable or disable the Hermes JS engine.
|
|
39
|
+
# If set to false, you will be using JSC instead.
|
|
40
|
+
hermesEnabled=false
|
|
41
|
+
|
|
42
|
+
NODE_BINARY=/Users/semsudin.tafilovic/.nvm/versions/node/v20.19.0/bin/node
|
|
43
|
+
|
|
44
|
+
org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
|
package/android/settings.gradle
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
pluginManagement {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
gradlePluginPortal()
|
|
6
|
+
}
|
|
7
|
+
plugins {
|
|
8
|
+
id("com.android.library") version("8.13.0") // 👈 for library
|
|
9
|
+
id("com.facebook.react") version("0.81.4") // 👈 for React Native
|
|
10
|
+
id("org.jetbrains.kotlin.android") version("2.2.20") // 👈 for Kotlin
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
dependencyResolutionManagement {
|
|
15
|
+
repositories {
|
|
16
|
+
google()
|
|
17
|
+
mavenLocal()
|
|
18
|
+
mavenCentral()
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
includeBuild("../node_modules/@react-native/gradle-plugin")
|
|
22
|
+
|
|
23
|
+
rootProject.name="MappEngagePlugin"
|
|
24
|
+
include(":MappEngagePlugin")
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
3
|
-
package="com.reactlibrary">
|
|
2
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
4
3
|
|
|
5
4
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
6
5
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
@@ -27,16 +26,16 @@
|
|
|
27
26
|
</receiver>
|
|
28
27
|
<activity
|
|
29
28
|
android:name=".HelperActivity"
|
|
30
|
-
android:exported="
|
|
29
|
+
android:exported="true"
|
|
30
|
+
android:taskAffinity=""
|
|
31
31
|
android:theme="@style/HelperActivityStyle">
|
|
32
|
-
|
|
33
32
|
<intent-filter android:label="mapp">
|
|
34
33
|
|
|
35
34
|
<data android:scheme="apx" />
|
|
36
35
|
<data android:host="deeplink" />
|
|
37
36
|
|
|
38
37
|
<action android:name="com.appoxee.VIEW_DEEPLINK" />
|
|
39
|
-
|
|
38
|
+
<action android:name="android.intent.action.VIEW" />
|
|
40
39
|
<category android:name="android.intent.category.DEFAULT" />
|
|
41
40
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
42
41
|
<category android:name="${applicationId}" />
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
android:name=".ActivityListener"
|
|
62
61
|
android:exported="false"
|
|
63
62
|
android:theme="@style/HelperActivityStyle">
|
|
64
|
-
<intent-filter>
|
|
63
|
+
<intent-filter tools:ignore="AppLinkUrlError">
|
|
65
64
|
<action android:name="com.mapp.RICH_PUSH" />
|
|
66
65
|
<category android:name="${applicationId}" />
|
|
67
66
|
|
|
@@ -6,14 +6,14 @@ import androidx.annotation.NonNull;
|
|
|
6
6
|
|
|
7
7
|
import com.appoxee.Appoxee;
|
|
8
8
|
import com.appoxee.internal.logger.LoggerFactory;
|
|
9
|
-
import com.
|
|
9
|
+
import com.google.firebase.messaging.FirebaseMessagingService;
|
|
10
10
|
import com.google.firebase.messaging.RemoteMessage;
|
|
11
11
|
|
|
12
|
+
import java.util.Map;
|
|
12
13
|
import java.util.concurrent.TimeUnit;
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
public class MessageService extends
|
|
16
|
-
|
|
16
|
+
public class MessageService extends FirebaseMessagingService {
|
|
17
17
|
@Override
|
|
18
18
|
public void onCreate() {
|
|
19
19
|
super.onCreate();
|
|
@@ -23,24 +23,30 @@ public class MessageService extends MappMessagingService {
|
|
|
23
23
|
@Override
|
|
24
24
|
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
|
|
25
25
|
Log.d("onMessageReceived", remoteMessage.toString());
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Map<String, String> data = remoteMessage.getData();
|
|
27
|
+
if (data.containsKey("p")) {
|
|
28
|
+
waitInitialization();
|
|
29
|
+
Appoxee.instance().setRemoteMessage(remoteMessage);
|
|
30
|
+
} else {
|
|
31
|
+
super.onMessageReceived(remoteMessage);
|
|
32
|
+
}
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
@Override
|
|
31
|
-
public void onNewToken(String s) {
|
|
36
|
+
public void onNewToken(@NonNull String s) {
|
|
32
37
|
waitInitialization();
|
|
38
|
+
Appoxee.instance().setToken(s);
|
|
33
39
|
super.onNewToken(s);
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
private void waitInitialization(){
|
|
37
|
-
int limit=15;
|
|
38
|
-
try{
|
|
42
|
+
private void waitInitialization() {
|
|
43
|
+
int limit = 15;
|
|
44
|
+
try {
|
|
39
45
|
while (limit >= 0 && !Appoxee.instance().isReady()) {
|
|
40
46
|
TimeUnit.MILLISECONDS.sleep(300);
|
|
41
47
|
limit--;
|
|
42
48
|
}
|
|
43
|
-
}catch (Exception e){
|
|
49
|
+
} catch (Exception e) {
|
|
44
50
|
LoggerFactory.getDevLogger().e(e.getMessage());
|
|
45
51
|
}
|
|
46
52
|
}
|
|
@@ -7,6 +7,7 @@ import android.content.pm.ActivityInfo;
|
|
|
7
7
|
import android.content.pm.PackageManager;
|
|
8
8
|
import android.os.Build;
|
|
9
9
|
|
|
10
|
+
import androidx.annotation.NonNull;
|
|
10
11
|
import androidx.annotation.Nullable;
|
|
11
12
|
import androidx.core.app.NotificationManagerCompat;
|
|
12
13
|
import androidx.core.content.ContextCompat;
|
|
@@ -14,6 +15,7 @@ import androidx.core.content.ContextCompat;
|
|
|
14
15
|
import com.appoxee.Appoxee;
|
|
15
16
|
import com.appoxee.AppoxeeOptions;
|
|
16
17
|
import com.appoxee.DeviceInfo;
|
|
18
|
+
import com.appoxee.GetCustomAttributesCallback;
|
|
17
19
|
import com.appoxee.internal.inapp.model.APXInboxMessage;
|
|
18
20
|
import com.appoxee.internal.inapp.model.ApxInAppExtras;
|
|
19
21
|
import com.appoxee.internal.inapp.model.InAppInboxCallback;
|
|
@@ -36,14 +38,24 @@ import com.facebook.react.bridge.Promise;
|
|
|
36
38
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
37
39
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
38
40
|
import com.facebook.react.bridge.ReactMethod;
|
|
41
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
42
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
39
43
|
import com.facebook.react.bridge.WritableArray;
|
|
40
44
|
import com.facebook.react.bridge.WritableMap;
|
|
41
45
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
46
|
+
import com.facebook.react.module.annotations.ReactModule;
|
|
47
|
+
import com.google.android.gms.tasks.OnCompleteListener;
|
|
48
|
+
import com.google.android.gms.tasks.Task;
|
|
49
|
+
import com.google.firebase.messaging.FirebaseMessaging;
|
|
42
50
|
import com.google.firebase.messaging.RemoteMessage;
|
|
43
51
|
|
|
44
52
|
import org.json.JSONException;
|
|
45
53
|
import org.json.JSONObject;
|
|
46
54
|
|
|
55
|
+
import java.util.ArrayList;
|
|
56
|
+
import java.util.Collections;
|
|
57
|
+
import java.util.Date;
|
|
58
|
+
import java.util.HashMap;
|
|
47
59
|
import java.util.Iterator;
|
|
48
60
|
import java.util.List;
|
|
49
61
|
import java.util.Map;
|
|
@@ -55,8 +67,10 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
|
55
67
|
* Copyright (c) 2019 MAPP.
|
|
56
68
|
*/
|
|
57
69
|
@SuppressWarnings("ALL")
|
|
70
|
+
@ReactModule(name = RNMappPluginModule.NAME)
|
|
58
71
|
public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
59
72
|
|
|
73
|
+
public static final String NAME = "RNMappPluginModule";
|
|
60
74
|
private final ReactApplicationContext reactContext;
|
|
61
75
|
private Map<Callback, String> mFeedSubscriberMap = new ConcurrentHashMap<>();
|
|
62
76
|
private Map<Callback, Boolean> mCallbackWasCalledMap = new ConcurrentHashMap<>();
|
|
@@ -70,7 +84,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
70
84
|
|
|
71
85
|
@Override
|
|
72
86
|
public String getName() {
|
|
73
|
-
return
|
|
87
|
+
return NAME;
|
|
74
88
|
}
|
|
75
89
|
|
|
76
90
|
@Override
|
|
@@ -163,8 +177,9 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
163
177
|
if (remoteMessage != null) {
|
|
164
178
|
Appoxee.instance().setRemoteMessage(remoteMessage);
|
|
165
179
|
promise.resolve(true);
|
|
180
|
+
} else {
|
|
181
|
+
promise.resolve(false);
|
|
166
182
|
}
|
|
167
|
-
promise.resolve(false);
|
|
168
183
|
}
|
|
169
184
|
|
|
170
185
|
@ReactMethod
|
|
@@ -186,17 +201,24 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
186
201
|
|
|
187
202
|
@ReactMethod
|
|
188
203
|
public void getToken(Promise promise) {
|
|
189
|
-
|
|
204
|
+
FirebaseMessaging.getInstance().getToken().addOnCompleteListener(new OnCompleteListener<String>() {
|
|
190
205
|
@Override
|
|
191
|
-
public void
|
|
192
|
-
|
|
206
|
+
public void onComplete(@NonNull Task<String> task) {
|
|
207
|
+
String token = task.getResult();
|
|
208
|
+
promise.resolve(token);
|
|
193
209
|
}
|
|
194
210
|
});
|
|
195
211
|
}
|
|
196
212
|
|
|
197
213
|
@ReactMethod
|
|
198
214
|
public void setAlias(String alias, Promise promise) {
|
|
199
|
-
Appoxee.instance().setAlias(alias);
|
|
215
|
+
Appoxee.instance().setAlias(alias, false);
|
|
216
|
+
promise.resolve(true);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@ReactMethod
|
|
220
|
+
public void setAliasWithResend(String alias, boolean resendCustomAttributes, Promise promise) {
|
|
221
|
+
Appoxee.instance().setAlias(alias, resendCustomAttributes);
|
|
200
222
|
promise.resolve(true);
|
|
201
223
|
}
|
|
202
224
|
|
|
@@ -274,6 +296,60 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
274
296
|
});
|
|
275
297
|
}
|
|
276
298
|
|
|
299
|
+
@ReactMethod
|
|
300
|
+
public void setAttributes(ReadableMap attributes, Promise promise) {
|
|
301
|
+
if (attributes != null) {
|
|
302
|
+
Map<String, Object> internapMap = new HashMap<>();
|
|
303
|
+
attributes.getEntryIterator().forEachRemaining(entry -> {
|
|
304
|
+
Object value = entry.getValue() == null ? "" : entry.getValue();
|
|
305
|
+
String key = entry.getKey();
|
|
306
|
+
|
|
307
|
+
if (value instanceof Number) {
|
|
308
|
+
internapMap.put(key, ((Number) value).doubleValue());
|
|
309
|
+
} else if (value instanceof Boolean) {
|
|
310
|
+
internapMap.put(key, ((Boolean) value).booleanValue());
|
|
311
|
+
} else if (value instanceof Date) {
|
|
312
|
+
internapMap.put(key, ((Date) value).getDate());
|
|
313
|
+
} else {
|
|
314
|
+
internapMap.put(key, ((String) value));
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
Appoxee.instance().setAttributes(internapMap);
|
|
318
|
+
}
|
|
319
|
+
promise.resolve(true);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@ReactMethod
|
|
323
|
+
public void getAttributes(ReadableArray keys, Promise promise) {
|
|
324
|
+
List<String> internalKeys = new ArrayList<>();
|
|
325
|
+
|
|
326
|
+
if (keys != null && keys.size() > 0) {
|
|
327
|
+
for (int i = 0; i < keys.size(); i++) {
|
|
328
|
+
internalKeys.add(keys.getString(i));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (internalKeys.size() > 0) {
|
|
333
|
+
Appoxee.instance().getCustomAttributes(internalKeys, new GetCustomAttributesCallback() {
|
|
334
|
+
@Override
|
|
335
|
+
public void onSuccess(Map<String, String> customAttributes) {
|
|
336
|
+
WritableMap resultMap = new WritableNativeMap();
|
|
337
|
+
for (Map.Entry<String, String> entry : customAttributes.entrySet()) {
|
|
338
|
+
resultMap.putString(entry.getKey(), entry.getValue());
|
|
339
|
+
}
|
|
340
|
+
promise.resolve(resultMap);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@Override
|
|
344
|
+
public void onError(String errorMessage) {
|
|
345
|
+
promise.reject(new Throwable(errorMessage));
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
} else {
|
|
349
|
+
promise.resolve(Collections.emptyMap());
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
277
353
|
@ReactMethod
|
|
278
354
|
public void setAttribute(String key, String value) {
|
|
279
355
|
Appoxee.instance().setAttribute(key, value);
|
|
@@ -445,7 +521,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
445
521
|
public void inAppMarkAsRead(Integer templateId, String eventId) {
|
|
446
522
|
Appoxee.instance().triggerStatistcs((getCurrentActivity()), getInAppStatisticsRequestObject(templateId,
|
|
447
523
|
eventId,
|
|
448
|
-
InAppStatistics.INBOX_INBOX_MESSAGE_READ_KEY,
|
|
524
|
+
InAppStatistics.INBOX_INBOX_MESSAGE_READ_KEY, -1, null, null));
|
|
449
525
|
}
|
|
450
526
|
|
|
451
527
|
@ReactMethod
|
|
@@ -453,7 +529,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
453
529
|
Appoxee.instance().triggerStatistcs((reactContext.getApplicationContext()),
|
|
454
530
|
getInAppStatisticsRequestObject(templateId,
|
|
455
531
|
eventId,
|
|
456
|
-
InAppStatistics.INBOX_INBOX_MESSAGE_UNREAD_KEY,
|
|
532
|
+
InAppStatistics.INBOX_INBOX_MESSAGE_UNREAD_KEY, -1, null, null));
|
|
457
533
|
}
|
|
458
534
|
|
|
459
535
|
@ReactMethod
|
|
@@ -461,12 +537,12 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
461
537
|
Appoxee.instance().triggerStatistcs((reactContext.getApplicationContext()),
|
|
462
538
|
getInAppStatisticsRequestObject(templateId,
|
|
463
539
|
eventId,
|
|
464
|
-
InAppStatistics.INBOX_INBOX_MESSAGE_DELETED_KEY,
|
|
540
|
+
InAppStatistics.INBOX_INBOX_MESSAGE_DELETED_KEY, -1, null, null));
|
|
465
541
|
}
|
|
466
542
|
|
|
467
543
|
@ReactMethod
|
|
468
544
|
public void triggerStatistic(Integer templateId, String originalEventId,
|
|
469
|
-
String trackingKey,
|
|
545
|
+
String trackingKey, int displayMillis,
|
|
470
546
|
String reason, String link) {
|
|
471
547
|
Appoxee.instance()
|
|
472
548
|
.triggerStatistcs((reactContext.getApplicationContext()), getInAppStatisticsRequestObject(templateId,
|
|
@@ -514,7 +590,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
514
590
|
}
|
|
515
591
|
|
|
516
592
|
private static InAppStatistics getInAppStatisticsRequestObject(int templateId, String originalEventId,
|
|
517
|
-
String trackingKey,
|
|
593
|
+
String trackingKey, int displayMillis,
|
|
518
594
|
String reason, String link) {
|
|
519
595
|
|
|
520
596
|
InAppStatistics inAppStatistics = new InAppStatistics();
|
|
@@ -526,7 +602,10 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
526
602
|
Tracking tk = new Tracking();
|
|
527
603
|
tk.setTrackingKey(trackingKey);
|
|
528
604
|
TrackingAttributes ta = new TrackingAttributes();
|
|
529
|
-
|
|
605
|
+
int displayTime = displayMillis >= 0 ? displayMillis : -1;
|
|
606
|
+
if (displayTime > 0) {
|
|
607
|
+
ta.setTimeSinceDisplayMillis((long) displayMillis);
|
|
608
|
+
}
|
|
530
609
|
ta.setReason(reason);
|
|
531
610
|
ta.setLink(link);
|
|
532
611
|
tk.setTrackingAttributes(ta);
|