infobip-mobile-messaging-react-native-plugin 6.1.0 → 6.2.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/infobip-mobile-messaging-react-native-plugin.svg)](https://www.npmjs.com/package/infobip-mobile-messaging-react-native-plugin)
4
4
 
5
- Mobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of [Infobip IP Messaging Platform](https://portal.infobip.com/push/).
5
+ Mobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of [Infobip IP Messaging Platform](https://portal.infobip.com/push/).
6
6
  The document describes library integration steps for your React Native project.
7
7
 
8
8
  * [Requirements](#requirements)
@@ -17,12 +17,12 @@ The document describes library integration steps for your React Native project.
17
17
  For iOS project:
18
18
  - Xcode and Command Line Tools (13.2.1)
19
19
  - CocoaPods (v1.11.3)
20
- - Minimum deployment target 11.0
20
+ - Minimum deployment target 12.0
21
21
 
22
22
  For Android project:
23
23
  - Android Studio (Bumblebee | 2021.1.1)
24
24
  - Gradle (v7.3.3)
25
- - Minimum API Level: 21 (Android 5.0 - [Lollipop](https://developer.android.com/about/versions/lollipop))
25
+ - Supported API Levels: 21 (Android 5.0 - [Lollipop](https://developer.android.com/about/versions/lollipop)) - 31 (Android 12.0)
26
26
 
27
27
  ## Quick start guide
28
28
 
@@ -38,51 +38,63 @@ This guide is designed to get you up and running with Mobile Messaging SDK plugi
38
38
 
39
39
  3. Configure platforms
40
40
 
41
- - **iOS**
42
- 1. Add `use_frameworks!` into `/ios/Podfile` (required for Swift frameworks such as our Mobile Messaging SDK)
43
- 2. Run `pod install` from `/ios` folder (installs Mobile Messaging native SDK)
44
- 3. Import following header `#import <MobileMessaging/MobileMessagingPluginApplicationDelegate.h>` and add `[MobileMessagingPluginApplicationDelegate install];` into `/ios/<ProjectName>/AppDelegate.m` (this is required for OS callbacks such as `didRegisterForRemoteNotifications` to be intercepted by native MobileMessaging SDK)
45
- ```objective-c
46
- ...
47
- #import <MobileMessaging/MobileMessagingPluginApplicationDelegate.h>
48
-
49
- @implementation AppDelegate
50
-
51
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
52
- {
53
- [MobileMessagingPluginApplicationDelegate install];
54
- ...
55
- }
56
- ...
57
- ```
58
- 4. Configure your project to support Push Notification as described in item 2 of [iOS integration quick start guide](https://github.com/infobip/mobile-messaging-sdk-ios#quick-start-guide)
59
- 5. [Integrate Notification Service Extension](https://github.com/infobip/mobile-messaging-sdk-ios/wiki/Notification-Service-Extension-for-Rich-Notifications-and-better-delivery-reporting-on-iOS-10) into your app in order to obtain:
60
- - more accurate processing of messages and delivery stats
61
- - support of rich notifications on the lock screen
62
- - **Android**
63
- 1. Following paths should be provided in .bash_profile
64
- ```sh
65
- export ANDROID_HOME=$HOME/Library/Android/sdk
66
- export PATH=$PATH:$ANDROID_HOME/emulator
67
- export PATH=$PATH:$ANDROID_HOME/tools
68
- export PATH=$PATH:$ANDROID_HOME/tools/bin
69
- export PATH=$PATH:$ANDROID_HOME/platform-tools
70
- ```
71
- 2. Add 'com.google.gms:google-services' to `android/build.gradle` file
72
- ```groovy
73
- buildscript {
41
+ - **iOS**
42
+ > ### Notice
43
+ > Starting from the [6.2.0](https://github.com/infobip/mobile-messaging-react-native-plugin/releases/tag/6.1.0) plugin version it's not mandatory to add `use_frameworks!` to the `Podfile`, check the [Migration guide](https://github.com/infobip/mobile-messaging-react-native-plugin/wiki/Migration-guides#migration-from-610-to-620-in-case-you-are-getting-rid-of-use_frameworks-in-the-podfile) if you want to get rid of it.
44
+ 1. Run `pod install` from `/ios` folder (installs Mobile Messaging native SDK)
45
+ 2. Import following header `#import <MobileMessaging/MobileMessagingPluginApplicationDelegate.h>` and add `[MobileMessagingPluginApplicationDelegate install];` into `/ios/<ProjectName>/AppDelegate.m` (this is required for OS callbacks such as `didRegisterForRemoteNotifications` to be intercepted by native MobileMessaging SDK)
46
+ ```objective-c
74
47
  ...
75
- dependencies {
48
+ #import <MobileMessaging/MobileMessagingPluginApplicationDelegate.h>
49
+
50
+ @implementation AppDelegate
51
+
52
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
53
+ {
54
+ [MobileMessagingPluginApplicationDelegate install];
76
55
  ...
77
- //GMS Gradle plugin
78
- classpath 'com.google.gms:google-services:4.3.10'
79
56
  }
80
- }
81
- ```
82
- And add `apply plugin: 'com.google.gms.google-services'` at the end of your `android/app/build.gradle` in order to apply [Google Services Gradle Plugin](https://developers.google.com/android/guides/google-services-plugin)
83
- 3. Add a Firebase configuration file (google-services.json) as described in <a href="https://firebase.google.com/docs/android/setup#add-config-file" target="_blank">`Firebase documentation`</a>
84
- > ### Notice:
85
- > Check <a href="https://github.com/infobip/mobile-messaging-react-native-plugin/wiki/Applying-Firebase-configuration-in-MobileMessaging-SDK">Applying Firebase configuration in MobileMessaging SDK Guide</a> for alternatives.
57
+ ...
58
+ ```
59
+ 3. Configure your project to support Push Notification as described in item 2 of [iOS integration quick start guide](https://github.com/infobip/mobile-messaging-sdk-ios#quick-start-guide)
60
+ 4. [Integrate Notification Service Extension](https://github.com/infobip/mobile-messaging-react-native-plugin/wiki/Delivery-improvements-and-rich-content-notifications#setting-up-ios-part) into your app in order to obtain:
61
+ - more accurate processing of messages and delivery stats
62
+ - support of rich notifications on the lock screen
63
+ - **Android**
64
+ 1. Following paths should be provided in .bash_profile
65
+ ```sh
66
+ export ANDROID_HOME=$HOME/Library/Android/sdk
67
+ export PATH=$PATH:$ANDROID_HOME/emulator
68
+ export PATH=$PATH:$ANDROID_HOME/tools
69
+ export PATH=$PATH:$ANDROID_HOME/tools/bin
70
+ export PATH=$PATH:$ANDROID_HOME/platform-tools
71
+ ```
72
+ 2. Add 'com.google.gms:google-services' to `android/build.gradle` file
73
+ ```groovy
74
+ buildscript {
75
+ ...
76
+ dependencies {
77
+ ...
78
+ //GMS Gradle plugin
79
+ classpath 'com.google.gms:google-services:4.3.10'
80
+ }
81
+ }
82
+ ```
83
+ And add `apply plugin: 'com.google.gms.google-services'` at the end of your `android/app/build.gradle` in order to apply [Google Services Gradle Plugin](https://developers.google.com/android/guides/google-services-plugin)
84
+
85
+ 3. Add a Firebase configuration file (google-services.json) as described in <a href="https://firebase.google.com/docs/android/setup#add-config-file" target="_blank">`Firebase documentation`</a>. Check <a href="https://github.com/infobip/mobile-messaging-react-native-plugin/wiki/Applying-Firebase-configuration-in-MobileMessaging-SDK">Applying Firebase configuration in MobileMessaging SDK Guide</a> for alternatives.
86
+
87
+ > ### Notice (check if you don't plan to use [Geofencing](https://github.com/infobip/mobile-messaging-react-native-plugin/wiki/Geofencing#android)):
88
+ > As long as Geofencing is automatically included to the plugin, it adds required geo permissions automatically. You can remove them from `/android/app/src/main/AndroidManifest.xml` by adding following:
89
+ > ```
90
+ > <manifest ... xmlns:tools="http://schemas.android.com/tools">
91
+ > ...
92
+ > <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove" />
93
+ > <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove" />
94
+ > <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove" />
95
+ > ...
96
+ > </manifest>
97
+ > ```
86
98
 
87
99
  ## Initialization configuration
88
100
 
@@ -90,24 +102,24 @@ Initialize Mobile Messaging React Native plugin, provide application configurati
90
102
 
91
103
  ```javascript
92
104
  import { mobileMessaging } from 'infobip-mobile-messaging-react-native-plugin';
93
-
105
+
94
106
  someMethod(): void {
95
- ...
96
-
97
- mobileMessaging.init(
98
- {
99
- applicationCode: '<your app code>',
100
- ios: {
101
- notificationTypes: ['alert', 'badge', 'sound'],
102
- },
103
- },
104
- () => {
105
- console.log('MobileMessaging started');
106
- },
107
- error => {
108
- console.log('MobileMessaging error: ', error);
109
- },
110
- );
107
+ ...
108
+
109
+ mobileMessaging.init(
110
+ {
111
+ applicationCode: '<your app code>',
112
+ ios: {
113
+ notificationTypes: ['alert', 'badge', 'sound'],
114
+ },
115
+ },
116
+ () => {
117
+ console.log('MobileMessaging started');
118
+ },
119
+ error => {
120
+ console.log('MobileMessaging error: ', error);
121
+ },
122
+ );
111
123
  }
112
124
  ```
113
125
  <details><summary>expand to see TypeScript code</summary>
@@ -115,24 +127,24 @@ someMethod(): void {
115
127
 
116
128
  ```typescript
117
129
  import { mobileMessaging } from 'infobip-mobile-messaging-react-native-plugin';
118
-
130
+
119
131
  someMethod(): void {
120
- ...
121
-
122
- mobileMessaging.init(
123
- {
124
- applicationCode: '<your app code>',
125
- ios: {
126
- notificationTypes: ['alert', 'badge', 'sound'],
127
- },
128
- },
129
- () => {
130
- console.log('MobileMessaging started');
131
- },
132
- (error: MobileMessagingError) => {
133
- console.log('MobileMessaging error: ', error);
134
- },
135
- );
132
+ ...
133
+
134
+ mobileMessaging.init(
135
+ {
136
+ applicationCode: '<your app code>',
137
+ ios: {
138
+ notificationTypes: ['alert', 'badge', 'sound'],
139
+ },
140
+ },
141
+ () => {
142
+ console.log('MobileMessaging started');
143
+ },
144
+ (error: MobileMessagingError) => {
145
+ console.log('MobileMessaging error: ', error);
146
+ },
147
+ );
136
148
  }
137
149
  ```
138
150
 
@@ -12,15 +12,15 @@ Pod::Spec.new do |s|
12
12
  s.homepage = "https://github.com/infobip/mobile-messaging-react-native-plugin"
13
13
  s.license = "MIT"
14
14
  s.authors = { "Infobip" => "Push.Support@infobip.com" }
15
- s.platforms = { :ios => "10.0" }
15
+ s.platforms = { :ios => "12.0" }
16
16
  s.source = { :git => 'https://github.com/infobip/mobile-messaging-react-native-plugin.git', :tag => s.version}
17
17
  s.swift_version = '5'
18
18
  s.source_files = "ios/**/*.{h,m,swift}"
19
19
  s.requires_arc = true
20
20
 
21
21
  s.dependency "React-Core"
22
- s.dependency "MobileMessaging/Core", "9.2.16"
23
- s.dependency "MobileMessaging/Geofencing", "9.2.16"
24
- s.dependency "MobileMessaging/InAppChat", "9.2.16"
22
+ s.dependency "MobileMessaging/Core", "10.2.1"
23
+ s.dependency "MobileMessaging/Geofencing", "10.2.1"
24
+ s.dependency "MobileMessaging/InAppChat", "10.2.1"
25
25
 
26
26
  end
package/ios/Cartfile CHANGED
@@ -1 +1 @@
1
- github "infobip/mobile-messaging-sdk-ios" "9.2.16"
1
+ github "infobip/mobile-messaging-sdk-ios" "10.2.1"
@@ -1 +1 @@
1
- github "infobip/mobile-messaging-sdk-ios" "9.2.16"
1
+ github "infobip/mobile-messaging-sdk-ios" "10.2.1"
@@ -4,3 +4,4 @@
4
4
 
5
5
  #import <React/RCTBridgeModule.h>
6
6
  #import <React/RCTEventEmitter.h>
7
+ #import <React/RCTViewManager.h>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "infobip-mobile-messaging-react-native-plugin",
3
3
  "title": "Infobip Mobile Messaging React Native Plugin",
4
- "version": "6.1.0",
4
+ "version": "6.2.0",
5
5
  "description": "Infobip Mobile Messaging React Native Plugin",
6
6
  "main": "index.js",
7
7
  "scripts": {