react-native-mapp-plugin 1.1.3 → 1.2.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/Mapp.js +12 -1
- package/RNMappPlugin.podspec +1 -1
- package/__package.json +1 -1
- package/android/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/android/build.gradle +6 -6
- package/android/src/main/java/com/reactlibrary/RNMappPluginModule.java +6 -3
- package/ios/RNMappEventEmmiter.m +11 -5
- package/ios/RNMappPluginModule.m +8 -3
- package/package.json +4 -4
package/Mapp.js
CHANGED
|
@@ -301,7 +301,18 @@ export class Mapp {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
static fetchLatestInboxMessage(): Promise<any>{
|
|
304
|
-
|
|
304
|
+
if (Platform.OS == "ios") {
|
|
305
|
+
print("fatch latest message for iOS part")
|
|
306
|
+
RNMappPluginModule.fetchLatestInboxMessage();
|
|
307
|
+
this.addInboxMessagesListener(messages => {
|
|
308
|
+
print("message arrived ", messages, " length", messages[messages.length - 1])
|
|
309
|
+
messages.sort((message1, message2) => message1["template_id"] > message2["template_id"]);
|
|
310
|
+
alert(JSON.stringify(messages[0]));
|
|
311
|
+
return JSON.stringify(messages[0]);
|
|
312
|
+
});
|
|
313
|
+
} else {
|
|
314
|
+
return RNMappPluginModule.fetchLatestInboxMessage();
|
|
315
|
+
}
|
|
305
316
|
}
|
|
306
317
|
|
|
307
318
|
static fetchInboxMessage(): Promise<any> {
|
package/RNMappPlugin.podspec
CHANGED
package/__package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
arguments=--init-script /var/folders/t6/pvjmf_n16v706r03q_t_vlx58tvf6j/T/
|
|
1
|
+
arguments=--init-script /var/folders/t6/pvjmf_n16v706r03q_t_vlx58tvf6j/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/t6/pvjmf_n16v706r03q_t_vlx58tvf6j/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
|
|
2
2
|
auto.sync=true
|
|
3
3
|
build.scans.enabled=false
|
|
4
4
|
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
package/android/build.gradle
CHANGED
|
@@ -57,15 +57,15 @@ dependencies {
|
|
|
57
57
|
implementation('com.facebook.react:react-native:0.20.1')
|
|
58
58
|
implementation 'com.google.code.gson:gson:2.10.1'
|
|
59
59
|
//implementation 'com.google.dagger:dagger:2.24'
|
|
60
|
-
implementation 'androidx.appcompat:appcompat:1.
|
|
61
|
-
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.
|
|
62
|
-
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.
|
|
60
|
+
implementation 'androidx.appcompat:appcompat:1.7.0'
|
|
61
|
+
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.8.3'
|
|
62
|
+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3'
|
|
63
63
|
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
|
|
64
|
-
implementation platform('com.google.firebase:firebase-bom:
|
|
64
|
+
implementation platform('com.google.firebase:firebase-bom:33.6.0')
|
|
65
65
|
implementation('com.google.firebase:firebase-messaging')
|
|
66
|
-
api('com.google.android.gms:play-services-location:21.
|
|
66
|
+
api('com.google.android.gms:play-services-location:21.3.0')
|
|
67
67
|
implementation 'androidx.media:media:1.7.0'
|
|
68
68
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
69
|
-
implementation("com.mapp.sdk:mapp-android:6.0.
|
|
69
|
+
implementation("com.mapp.sdk:mapp-android:6.0.25")
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -79,9 +79,11 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
79
79
|
getReactApplicationContext().addLifecycleEventListener(new LifecycleEventListener() {
|
|
80
80
|
@Override
|
|
81
81
|
public void onHostResume() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Appoxee.
|
|
82
|
+
// Commented out for now.
|
|
83
|
+
// It prevents the app from channging registered channel with a new one.
|
|
84
|
+
// Appoxee.engage(application);
|
|
85
|
+
// Appoxee.setOrientation(application, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
86
|
+
// Appoxee.instance().setReceiver(MyPushBroadcastReceiver.class);
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
@Override
|
|
@@ -215,6 +217,7 @@ public class RNMappPluginModule extends ReactContextBaseJavaModule {
|
|
|
215
217
|
opt.notificationMode = NotificationMode.BACKGROUND_AND_FOREGROUND;
|
|
216
218
|
opt.tenantID = tenantID;
|
|
217
219
|
Appoxee.engage(Objects.requireNonNull(application), opt);
|
|
220
|
+
|
|
218
221
|
Appoxee.instance().addInitListener(new Appoxee.OnInitCompletedListener() {
|
|
219
222
|
@Override
|
|
220
223
|
public void onInitCompleted(boolean successful, Exception failReason) {
|
package/ios/RNMappEventEmmiter.m
CHANGED
|
@@ -170,12 +170,18 @@ NSString *const MappRNInappMessage = @"com.mapp.inapp_message";
|
|
|
170
170
|
-(NSDictionary *) getRichMessage: (APXRichMessage *) message {
|
|
171
171
|
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
|
172
172
|
[dict setObject:[[NSNumber numberWithInteger:message.uniqueID] stringValue] forKey:@"id"];
|
|
173
|
-
|
|
173
|
+
if (message.title)
|
|
174
|
+
[dict setObject:message.title forKey:@"title"];
|
|
175
|
+
if (message.content)
|
|
174
176
|
[dict setObject:message.content forKey:@"content"];
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
if (message.title)
|
|
178
|
+
[dict setObject:message.title forKey:@"title"];
|
|
179
|
+
if (message.messageLink)
|
|
180
|
+
[dict setObject:message.messageLink forKey:@"messageLink"];
|
|
181
|
+
if (message.postDate)
|
|
182
|
+
[dict setObject:[self stringFromDate: message.postDate inUTC:false] forKey:@"postDate"];
|
|
183
|
+
if (message.postDate)
|
|
184
|
+
[dict setObject:[self stringFromDate: message.postDate inUTC:true] forKey:@"postDateUTC"];
|
|
179
185
|
return dict;
|
|
180
186
|
|
|
181
187
|
}
|
package/ios/RNMappPluginModule.m
CHANGED
|
@@ -228,25 +228,30 @@ RCT_EXPORT_METHOD(fetchInboxMessage: (RCTPromiseResolveBlock)resolve rejecter:(R
|
|
|
228
228
|
resolve(@"Fetching, set event listener for iOS");
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
RCT_EXPORT_METHOD(fetchLatestInboxMessage: (RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
|
232
|
+
[[AppoxeeInapp shared] fetchAPXInBoxMessages];
|
|
233
|
+
resolve(@"Fetching, set event listener for iOS");
|
|
234
|
+
}
|
|
235
|
+
|
|
231
236
|
RCT_EXPORT_METHOD(triggerInApp: (NSString *) event) {
|
|
232
237
|
[[AppoxeeInapp shared] reportInteractionEventWithName:event andAttributes:nil];
|
|
233
238
|
}
|
|
234
239
|
|
|
235
|
-
RCT_EXPORT_METHOD(inAppMarkAsRead: (NSNumber *) templateId event: (NSString *) eventId) {
|
|
240
|
+
RCT_EXPORT_METHOD(inAppMarkAsRead: (NSNumber * _Nonnull) templateId event: (NSString * _Nonnull) eventId) {
|
|
236
241
|
APXInBoxMessage *message = [[RNMappEventEmmiter shared] getMessageWith:templateId event:eventId];
|
|
237
242
|
if (message) {
|
|
238
243
|
[message markAsRead];
|
|
239
244
|
}
|
|
240
245
|
}
|
|
241
246
|
|
|
242
|
-
RCT_EXPORT_METHOD(inAppMarkAsUnRead: (NSNumber *) templateId event: (NSString *) eventId) {
|
|
247
|
+
RCT_EXPORT_METHOD(inAppMarkAsUnRead: (NSNumber * _Nonnull) templateId event: (NSString * _Nonnull) eventId) {
|
|
243
248
|
APXInBoxMessage *message = [[RNMappEventEmmiter shared] getMessageWith:templateId event:eventId];
|
|
244
249
|
if (message) {
|
|
245
250
|
[message markAsUnread];
|
|
246
251
|
}
|
|
247
252
|
}
|
|
248
253
|
|
|
249
|
-
RCT_EXPORT_METHOD(inAppMarkAsDeleted: (NSNumber *) templateId event: (NSString *) eventId) {
|
|
254
|
+
RCT_EXPORT_METHOD(inAppMarkAsDeleted: (NSNumber * _Nonnull) templateId event: (NSString * _Nonnull) eventId) {
|
|
250
255
|
APXInBoxMessage *message = [[RNMappEventEmmiter shared] getMessageWith:templateId event:eventId];
|
|
251
256
|
if (message) {
|
|
252
257
|
[message markAsDeleted];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-mapp-plugin",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Mapp SDK for React Native.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -14,13 +14,13 @@
|
|
|
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": "^28.1.3",
|
|
22
|
-
"react": "
|
|
23
|
-
"react-native": "0.
|
|
22
|
+
"react": "19.0.0",
|
|
23
|
+
"react-native": "^0.78.0"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|