@selligent-marketing-cloud/selligent-react-native 2.9.0 → 3.0.0

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +117 -12
  3. package/android/build/generated/source/buildConfig/debug/com/selligent/BuildConfig.java +1 -1
  4. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +1 -1
  5. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +4 -2
  6. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
  7. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  8. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  9. package/android/build/intermediates/compile_symbol_list/debug/R.txt +478 -352
  10. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  11. package/android/build/intermediates/incremental/{packageDebugResources → debug/packageDebugResources}/merger.xml +0 -0
  12. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory.class +0 -0
  13. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventDataParser.class +0 -0
  14. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventType.class +0 -0
  15. package/android/build/intermediates/javac/debug/classes/com/selligent/BuildConfig.class +0 -0
  16. package/android/build/intermediates/javac/debug/classes/com/selligent/ButtonBroadcastEventDataParser.class +0 -0
  17. package/android/build/intermediates/javac/debug/classes/com/selligent/ClearCacheIntervalValue.class +0 -0
  18. package/android/build/intermediates/javac/debug/classes/com/selligent/Event.class +0 -0
  19. package/android/build/intermediates/javac/debug/classes/com/selligent/EventReceiver.class +0 -0
  20. package/android/build/intermediates/javac/debug/classes/com/selligent/EventType.class +0 -0
  21. package/android/build/intermediates/javac/debug/classes/com/selligent/GCMTokenBroadcastEventDataParser.class +0 -0
  22. package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageBroadcastEventDataParser.class +0 -0
  23. package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageRefreshType.class +0 -0
  24. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$2.class +0 -0
  25. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$3.class +0 -0
  26. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$4.class +0 -0
  27. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$5.class +0 -0
  28. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent.class +0 -0
  29. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligentPackage.class +0 -0
  30. package/android/build/intermediates/javac/debug/classes/com/selligent/RemoteMessageDisplayType.class +0 -0
  31. package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory.class +0 -0
  32. package/android/build/intermediates/javac/debug/classes/com/selligent/SMSettingsFactory.class +0 -0
  33. package/android/build/intermediates/javac/debug/classes/com/selligent/Settings.class +0 -0
  34. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +1 -1
  35. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +1 -1
  36. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +4 -2
  37. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  38. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +214 -132
  39. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  40. package/android/build.gradle +27 -31
  41. package/android/libs/sdk-release.aar +0 -0
  42. package/android/src/main/java/com/selligent/ButtonBroadcastEventDataParser.java +1 -1
  43. package/android/src/main/java/com/selligent/RNSelligent.java +1 -1
  44. package/android/src/main/java/com/selligent/SMSettingsFactory.java +0 -1
  45. package/android/src/main/java/com/selligent/Settings.java +0 -8
  46. package/ios/libSelligentMobile.a +0 -0
  47. package/package.json +3 -3
  48. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.0] - 7 December 2022
4
+
5
+ ### Changed
6
+ - Add version 4.0.1 of the Android SDK to `android/libs`
7
+ - Remove everything to do with `googleApplicationId` from Android, as this setting was completely removed from Selligent's SDK
8
+ - On Android, use an SMNotificationButton's button action's `getValue()` method to get the action value, in accordance with Selligent's new API
9
+ - Change development dependency version of `react-native` to `^0.70.6`
10
+
11
+ ## [2.10.0] - 12 September 2022
12
+
13
+ ### Added
14
+ - Add section on application lifecycle management split between `AppDelegate` and `SceneDelegate` with regards to Selligent push notification handling on iOS 15+ in README
15
+ - Add a couple of markdown code language identifiers for syntax highlightinh in README
16
+ - Add disclaimer concerning this module's incompatibility with React Native's new architecture in README
17
+ - Add disclaimer plot project's minimum version upgrade to `3.5.0` for `iOS` in README
18
+
19
+ ### Changed
20
+ - Add version 3.10.1 of the Android SDK to `android/libs`
21
+ - Add version 2.7.7 of the iOS SDK static library to `/ios`
22
+ - Change development dependency versions of `react` and `react-native` to `18.1.0` and `^0.70.0`, respectively
23
+ - Upgrade the `compileSdkVersion` and `targetSdkVersion` to `32` in `android/build.gradle`
24
+ - Upgrade the Android Gradle Plugin version to `7.2.2`
25
+ - Upgrade the `om.google.code.gson:gson` and `androidx.work:work-runtime` dependencies to `2.8.9` and `2.7.1` respectively in `android/build.gradle`
26
+ - Change used native SDK version numbers to `3.10.1` and `2.7.7` for Android and iOS respectively in README
27
+
28
+ ### Fixed
29
+ - Fix typos in README
30
+
3
31
  ## [2.9.0] - 20 May 2022
4
32
 
5
33
  ### Added
package/README.md CHANGED
@@ -7,14 +7,16 @@ This module provides an API for the usage of the Selligent SDK in React Native.
7
7
  - Android
8
8
  - iOS
9
9
 
10
- > _**Important:** Since version 2.6.0 of this module we require your app to use the Android Gradle Plugin version 4.2.0 or higher in order to build on Android. This is the default Android Gradle Plugin version since React Native version 0.64.0 but can be manually increased in older versions of React Native._
10
+ > _**IMPORTANT:** Since version 2.6.0 of this module we require your app to use the Android Gradle Plugin version 4.2.0 or higher in order to build on Android. This is the default Android Gradle Plugin version since React Native version 0.64.0 but can be manually increased in older versions of React Native._
11
+
12
+ > _**IMPORTANT** Since version 2.10.0 of this module, we support React Native v0.70, but NOT REACT NATIVE'S NEW ARCHITECTURE! The following library contains React native modules, that are tailored to and can only be used in React Native's legacy architecture, that will be deprecated in the future when the new architecture will be stable._
11
13
 
12
14
  This module uses the native Selligent SDKs:
13
15
 
14
16
  | SDK | Version |
15
17
  | ----------------------------------------------------------------------- | ------- |
16
- | [Android](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 3.9.0 |
17
- | [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 2.7.4 |
18
+ | [Android](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 4.0.1 |
19
+ | [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 2.7.7 |
18
20
 
19
21
  ## ToC
20
22
 
@@ -300,7 +302,7 @@ This module uses the native Selligent SDKs:
300
302
 
301
303
  Add the following properties to the `selligent.json` file:
302
304
 
303
- ```
305
+ ```json
304
306
  "notificationSmallIcon": "ic_notification",
305
307
  "notificationLargeIcon": "ic_notification"
306
308
  ```
@@ -332,16 +334,18 @@ Add the following properties to the `selligent.json` file:
332
334
 
333
335
  5. Create a `Podfile` (if there isn't one already) in the `/ios` folder and add the following:
334
336
 
337
+ > **IMPORTANT:** Since v2.7.5 of the iOS SDK, the minimum PlotPlugin version is 3.5.0!
338
+
335
339
  ```ruby
336
340
  target 'REPLACEWITHYOURTARGETNAME'
337
- pod 'PlotPlugin', '3.3.2'
341
+ pod 'PlotPlugin', '3.5.0'
338
342
  ```
339
343
 
340
344
  6. Execute `pod install` in the `/ios` folder
341
345
 
342
346
  7. From now on open the `.xcworkspace` file to make changes in Xcode
343
347
 
344
- 8. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.m`
348
+ 8. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.mm`
345
349
 
346
350
  ```objective-c
347
351
  #import <RNSelligent.h>
@@ -359,9 +363,9 @@ Add the following properties to the `selligent.json` file:
359
363
 
360
364
  2. Execute `pod install` in the `/ios` folder
361
365
 
362
- 3. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.m`
366
+ 3. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.mm`
363
367
 
364
- ```objective-c
368
+ ```objc
365
369
  #import <RNSelligent.h>
366
370
  [RNSelligent configureWithLaunchOptions:launchOptions];
367
371
  ```
@@ -370,12 +374,15 @@ Add the following properties to the `selligent.json` file:
370
374
 
371
375
  #### Push notifications
372
376
 
373
- 1. For push notifications you need to delegate some of the `AppDelegate.m` methods to the SDK:
377
+ 1. For push notifications you need to delegate some of the `AppDelegate.mm` methods to the SDK:
374
378
 
375
- ```objective-c
379
+ ```objc
376
380
  #import "AppDelegate.h"
377
381
  #import <React/RCTBundleURLProvider.h>
378
382
  #import <React/RCTRootView.h>
383
+
384
+ #import <React/RCTAppSetupUtils.h>
385
+
379
386
  #import <RNSelligent.h>
380
387
 
381
388
  #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
@@ -441,7 +448,105 @@ Add the following properties to the `selligent.json` file:
441
448
  Make sure you add your `appGroupId` to the `selligent.json`.
442
449
  > **IMPORTANT!** make sure your `appGroupId` has the following structure or it will not work: `group.{MAIN_APP_BUNDLE_ID}`
443
450
 
444
- > **IMPORTAND** Since v2.9.0, `-(void)didReceiveNotification:(UNNotification *)notification` of `SMManager+RemoteNotification` has become deprecated. You will need to invoke `-(void)didReceiveNotification:(UNNotification *)notification withContext` instead. Consult [**the iOS documentation**](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Documentation#start-the-sdk-from-inside-the-extension-1) for more details.
451
+ > **IMPORTANT!** Since v2.9.0, `-(void)didReceiveNotification:(UNNotification *)notification` of `SMManager+RemoteNotification` has become deprecated. You will need to invoke `-(void)didReceiveNotification:(UNNotification *)notification withContext` instead. Consult [**the iOS documentation**](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Documentation#start-the-sdk-from-inside-the-extension-1) for more details.
452
+
453
+ 4. Starting from iOS 13, Apple split up the application lifecycle logic between `AppDelegate` and `SceneDelegate`.
454
+ This was done in order to enable multi-window support that was introduced in iPad-OS. The `AppDelegate` is responsible for application lifecycle handling and setup of services, while `SceneDelegate` is responsible for updating the UI (windows and scenes).
455
+
456
+ However, this split in responsibilites has given rise to issues with Sellgent's default push notification behavior __since iOS 15__, which shows an alert containing the notification's content, or its associated in-app content. Starting from iOS 15, you should add a separate `SceneDelegate`, that you connect to your `AppDelegate`, which handles the UI updating logic:
457
+
458
+ ``` objc
459
+ // SceneDelegate.h
460
+
461
+ #ifndef SceneDelegate_h
462
+ #define SceneDelegate_h
463
+
464
+ #import <UIKit/UIKit.h>
465
+ #import <React/RCTBridgeDelegate.h>
466
+
467
+ @interface SceneDelegate : UIResponder <UIWindowSceneDelegate, RCTBridgeDelegate>
468
+ @end
469
+
470
+ #endif /* SceneDelegate_h */
471
+ ```
472
+
473
+ ``` objc
474
+ // SceneDelegate.mm
475
+
476
+ #import "SceneDelegate.h"
477
+
478
+ #import <React/RCTBridge.h>
479
+ #import <React/RCTBundleURLProvider.h>
480
+ #import <React/RCTRootView.h>
481
+
482
+ #import <React/RCTAppSetupUtils.h>
483
+
484
+ @implementation SceneDelegate
485
+
486
+ #if defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
487
+
488
+ @synthesize window = _window;
489
+
490
+ - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions API_AVAILABLE(ios(13.0)){
491
+ RCTAppSetupPrepareApp([ UIApplication sharedApplication]);
492
+ // ...
493
+ // other react native setup code
494
+ // ...
495
+ }
496
+
497
+
498
+ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
499
+ {
500
+ #if DEBUG
501
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
502
+ #else
503
+ return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
504
+ #endif
505
+ }
506
+
507
+ #endif
508
+
509
+ @end
510
+
511
+ ```
512
+
513
+ ``` objc
514
+ // AppDelegate.mm
515
+ // Other imports...
516
+ #import "SceneDelegate.h"
517
+
518
+ @implementation AppDelegate
519
+
520
+ #if defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
521
+ - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options API_AVAILABLE(ios(13.0)){
522
+ UISceneConfiguration *configuration = [[UISceneConfiguration alloc] init];
523
+ configuration.delegateClass = SceneDelegate.class;
524
+
525
+ return configuration;
526
+ }
527
+ #endif
528
+
529
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
530
+ [self _prepareForPushNotifications];
531
+ [RNSelligent configureWithLaunchOptions:launchOptions];
532
+ //
533
+
534
+ if (@available(iOS 13.0, *)) {
535
+ return YES;
536
+ }
537
+ // ...
538
+ //react native setup code
539
+ // ...
540
+
541
+ return YES;
542
+ }
543
+
544
+
545
+ // Other AppDelegate methods, as defined above...
546
+
547
+ @end
548
+
549
+ ```
445
550
 
446
551
  #### Geolocation
447
552
 
@@ -451,7 +556,7 @@ For geolocation services, follow section [**Geolocation**](https://github.com/Se
451
556
 
452
557
  You can catch the deeplinks 2 ways:
453
558
 
454
- 1. Native in AppDelegate.m, add the following (example code that logs the URL)
559
+ 1. Native in AppDelegate.mm, add the following (example code that logs the URL)
455
560
 
456
561
  ```
457
562
  -(BOOL)application:(UIApplication*) application openURL:(NSURL*) url sourceApplication:(NSString*) sourceApplication annotation:(id) annotation
@@ -8,5 +8,5 @@ public final class BuildConfig {
8
8
  public static final String LIBRARY_PACKAGE_NAME = "com.selligent";
9
9
  public static final String BUILD_TYPE = "debug";
10
10
  // Selligent settings
11
- public static final String SELLIGENT_SETTINGS = "{\"url\":\"https://mobile.emsecure.net/mobilepush/api/\",\"clientId\":\"4acaf646-ef68-4b78-9a30-8412d3007cba\",\"privateKey\":\"TzYgBoYF+I1fZ+1Tapdpz+XQXKyLUZocDzmWV1kBYHKIQ8WWWXL61/m7FWo8mY6hSrAMVUoH1EaViq7+dgQ9Jg==\",\"fullyQualifiedNotificationActivityClassName\":\"com.selligentdevapprn.MainActivity\",\"inAppMessageRefreshType\":11,\"configureLocationServices\":true,\"notificationSmallIcon\":\"ic_notification\",\"notificationLargeIcon\":\"ic_notification\",\"notificationIconColor\":\"#FF0000\",\"appGroupId\":\"group.be.appfoundry.selligent.reactnative.development.app\",\"notificationChannelId\":\"SMChannel001\",\"notificationChannelName\":\"SMDefaultChannel\",\"notificationChannelDescription\":\"\"}";
11
+ public static final String SELLIGENT_SETTINGS = "{\"url\":\"https://mobile.emsecure.net/mobilepush/api/\",\"clientId\":\"4acaf646-ef68-4b78-9a30-8412d3007cba\",\"privateKey\":\"TzYgBoYF+I1fZ+1Tapdpz+XQXKyLUZocDzmWV1kBYHKIQ8WWWXL61/m7FWo8mY6hSrAMVUoH1EaViq7+dgQ9Jg==\",\"fullyQualifiedNotificationActivityClassName\":\"com.selligentdevapprn.MainActivity\",\"inAppMessageRefreshType\":11,\"configureLocationServices\":true,\"notificationSmallIcon\":\"ic_notification\",\"notificationLargeIcon\":\"ic_notification\",\"notificationIconColor\":\"#FF0000\",\"appGroupId\":\"group.be.appfoundry.selligent.reactnative.development.app\",\"notificationChannelId\":\"SMChannel001\",\"notificationChannelName\":\"SMDefaultChannel\",\"notificationChannelDescription\":\"\",\"shouldClearBadge\":true,\"shouldDisplayRemoteNotification\":true,\"clearCacheIntervalValue\":1}";
12
12
  }
@@ -4,6 +4,6 @@
4
4
 
5
5
  <uses-sdk
6
6
  android:minSdkVersion="21"
7
- android:targetSdkVersion="30" />
7
+ android:targetSdkVersion="32" />
8
8
 
9
9
  </manifest>
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 2,
2
+ "version": 3,
3
3
  "artifactType": {
4
4
  "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
5
  "kind": "Directory"
@@ -10,7 +10,9 @@
10
10
  {
11
11
  "type": "SINGLE",
12
12
  "filters": [],
13
+ "attributes": [],
13
14
  "outputFile": "AndroidManifest.xml"
14
15
  }
15
- ]
16
+ ],
17
+ "elementType": "File"
16
18
  }
@@ -1,2 +1,4 @@
1
1
  aarFormatVersion=1.0
2
2
  aarMetadataVersion=1.0
3
+ minCompileSdk=1
4
+ minAndroidGradlePluginVersion=1.0.0