pushwoosh-react-native-plugin 6.1.11 → 6.1.14

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
@@ -12,12 +12,27 @@ React Native Pushwoosh Push Notifications module
12
12
 
13
13
 
14
14
  ### Installation
15
-
16
15
  ```
17
16
  npm install pushwoosh-react-native-plugin --save
18
17
  react-native link pushwoosh-react-native-plugin
19
18
  ```
20
19
 
20
+ For Android platform, also add the following lines to your project's build.gradle:
21
+
22
+ ```
23
+ //you should already have buildscript and dependencies blocks in your project's build.gradle so just put the classpath line there
24
+ buildscript {
25
+ dependencies {
26
+ classpath 'com.google.gms:google-services:4.3.3'
27
+ }
28
+ }
29
+
30
+ //add these lines to the very end of your build.gradle
31
+ apply {
32
+ plugin com.google.gms.googleservices.GoogleServicesPlugin
33
+ }
34
+ ```
35
+
21
36
  ### Usage
22
37
 
23
38
  ```js
package/index.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ declare module 'pushwoosh-react-native-plugin' {
2
+ interface PushwooshConfig {
3
+ pw_appid: string;
4
+ project_number: string;
5
+ pw_notification_handling?: string;
6
+ }
7
+ type LocalNotification = {
8
+ msg: string;
9
+ seconds: number;
10
+ userData?: Object;
11
+ }
12
+
13
+ interface PushwooshTags {
14
+ [index: string]: string | number | string[] | number[]
15
+ }
16
+
17
+ interface Pushwoosh {
18
+ init(config: PushwooshConfig, success?: () => void, fail?: () => void): void;
19
+ createLocalNotification(notification: LocalNotification): void;
20
+ clearLocalNotification(): void;
21
+ clearNotificationCenter(): void;
22
+ register(success?: (token: string) => void, fail?: (error: Error) => void): void;
23
+ unregister(success?: (token: string) => void, fail?: (error: Error) => void): void;
24
+ onPushOpen(callback: () => void, fail?: ()=> void): void;
25
+ setTags(
26
+ tags: Record<string, PushwooshTags>,
27
+ success?: () => void,
28
+ fail?: (error: Error) => void
29
+ ): void;
30
+ getTags(success: (tags: PushwooshTags) => void, fail?: (error: Error) => void): void;
31
+ setShowPushnotificationAlert(showAlert: boolean): void;
32
+ getShowPushnotificationAlert(callback: (willShow: boolean) => void): void;
33
+ getPushToken(success?: (token: string) => void): void;
34
+ getHwid(success: (hwid: string) => void): void;
35
+ setUserId(userId: string, success?: ()=> void, fail?: (error: Error) => void): void;
36
+ postEvent(event: string, attributes?: Record<string, string>): void;
37
+ setApplicationIconBadgeNumber(badgeNumber: number): void;
38
+ getApplicationIconBadgeNumber(callback: (badge: number) => void): void;
39
+ addToApplicationIconBadgeNumber(badgeNumber: number): void;
40
+ setMultiNotificationMode(on: boolean): void;
41
+ setLightScreenOnNotification(on: boolean): void;
42
+ setEnableLED(on: boolean): void;
43
+ setColorLED(color: number): void;
44
+ setSoundType(type: number): void;
45
+ setVibrateType(type: number): void;
46
+ presentInboxUI(style?: Object): void;
47
+ showGDPRConsentUI(): void;
48
+ showGDPRDeletionUI(): void;
49
+ isDeviceDataRemoved(success: (isRemoved: boolean) => void): void;
50
+ isCommunicationEnabled(success: (isEnabled: boolean)=> void): void;
51
+ isAvailableGDPR(success: (isAvailable: boolean) => void): void;
52
+ setCommunicationEnabled(enabled: boolean, success?: () => void, fail?: (error: Error) => void): void;
53
+ removeAllDeviceData(success?: () => void, fail?: (error: Error) => void): void;
54
+ setNotificationIconBackgroundColor(color: string): void;
55
+ setLanguage(language: string): void;
56
+ enableHuaweiPushNotifications(): void;
57
+ }
58
+
59
+ declare const Pushwoosh: Pushwoosh;
60
+ export = Pushwoosh;
61
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "pushwoosh-react-native-plugin",
3
- "version": "6.1.11",
3
+ "version": "6.1.14",
4
4
  "description": "This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/Pushwoosh/pushwoosh-react-native-plugin.git"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = "pushwoosh-react-native-plugin"
3
- s.version = "6.1.11"
3
+ s.version = "6.1.14"
4
4
  s.summary = "React Native Pushwoosh Push Notifications module"
5
5
  s.requires_arc = true
6
6
  s.author = 'Pushwoosh'
@@ -15,6 +15,6 @@ Pod::Spec.new do |s|
15
15
  s.static_framework = true
16
16
 
17
17
  s.dependency 'React'
18
- s.dependency 'Pushwoosh'
19
- s.dependency 'PushwooshInboxUI'
20
- end
18
+ s.dependency 'PushwooshXCFramework'
19
+ s.dependency 'PushwooshInboxUIXCFramework'
20
+ end
@@ -1,6 +1,6 @@
1
1
  buildscript {
2
2
  repositories {
3
- jcenter()
3
+ mavenCentral()
4
4
  maven {
5
5
  url "https://maven.google.com"
6
6
  }
@@ -8,13 +8,12 @@ buildscript {
8
8
 
9
9
  dependencies {
10
10
  classpath 'com.android.tools.build:gradle:3.6.4'
11
- classpath 'com.google.gms:google-services:4.3.3'
12
11
  }
13
12
  }
14
13
 
15
14
  allprojects {
16
15
  repositories {
17
- jcenter()
16
+ mavenCentral()
18
17
  maven {
19
18
  url "https://maven.google.com"
20
19
  }
@@ -38,21 +37,11 @@ android {
38
37
  }
39
38
 
40
39
  ext {
41
- pushwoosh = "6.4.0"
40
+ pushwoosh = "6.5.2"
42
41
  }
43
42
 
44
43
  evaluationDependsOn(':app')
45
44
 
46
- rootProject.subprojects {
47
- if (name == "app") {
48
- if (!plugins.hasPlugin('com.google.gms.google-services')) {
49
- apply {
50
- plugin com.google.gms.googleservices.GoogleServicesPlugin
51
- }
52
- }
53
- }
54
- }
55
-
56
45
  dependencies {
57
46
  implementation 'com.facebook.react:react-native:+'
58
47
  implementation "com.pushwoosh:pushwoosh:${pushwoosh}"
@@ -11,7 +11,14 @@
11
11
  <meta-data
12
12
  android:name="com.pushwoosh.internal.plugin_provider"
13
13
  android:value="com.pushwoosh.reactnativeplugin.internal.ReactNativePluginProvider" />
14
+
15
+ <!-- <service android:name="com.pushwoosh.reactnativeplugin.CustomFirebaseMessagingService" android:exported="false">
16
+ <intent-filter>
17
+ <action android:name="com.google.firebase.MESSAGING_EVENT"/>
18
+ </intent-filter>
19
+ </service>
20
+ -->
14
21
 
15
22
  </application>
16
23
 
17
- </manifest>
24
+ </manifest>
@@ -0,0 +1,29 @@
1
+ package com.pushwoosh.plugin.pushnotifications;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.google.firebase.messaging.FirebaseMessagingService;
6
+ import com.google.firebase.messaging.RemoteMessage;
7
+ import com.pushwoosh.firebase.PushwooshFcmHelper;
8
+
9
+ public class CustomFirebaseMessagingService extends FirebaseMessagingService {
10
+ @Override
11
+ public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
12
+ if (PushwooshFcmHelper.isPushwooshMessage(remoteMessage)){
13
+ PushwooshFcmHelper.onMessageReceived(this, remoteMessage);
14
+ } else {
15
+ //handle push from a different service here
16
+ }
17
+ }
18
+
19
+ @Override
20
+ public void onNewToken(@NonNull String s) {
21
+ super.onNewToken(s);
22
+ PushwooshFcmHelper.onTokenRefresh(s);
23
+ sendTokenToAnotherService();
24
+ }
25
+
26
+ public void sendTokenToAnotherService() {
27
+ //handle push registration of another service here
28
+ }
29
+ }
@@ -28,6 +28,19 @@ NS_ASSUME_NONNULL_BEGIN
28
28
  */
29
29
  - (void)handleNotificationRequest:(UNNotificationRequest *)request contentHandler:(void (^)(UNNotificationContent *))contentHandler;
30
30
 
31
+ /**
32
+ Example:
33
+ @code
34
+ - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
35
+ self.contentHandler = contentHandler;
36
+ self.bestAttemptContent = [request.content mutableCopy];
37
+
38
+ [[PWNotificationExtensionManager sharedManager] handleNotificationRequest:request withAppGroups:@"group.com.example_domain.example_app_name."];
39
+ }
40
+ @endcode
41
+ */
42
+ - (void)handleNotificationRequest:(UNNotificationRequest *)request withAppGroups:(NSString * _Nullable)appGroupsName;
43
+
31
44
  @end
32
45
 
33
46
  NS_ASSUME_NONNULL_END
@@ -385,14 +385,6 @@ typedef void (^PushwooshErrorHandler)(NSError *error);
385
385
  */
386
386
  - (void)sendAppOpen;
387
387
 
388
- /**
389
- Sends current badge value to server. Called internally by SDK Runtime when `UIApplication` `setApplicationBadgeNumber:` is set. This function is used for "auto-incremeting" badges to work.
390
- This way Pushwoosh server can know what current badge value is set for the application.
391
-
392
- @param badge Current badge value.
393
- */
394
- - (void)sendBadges:(NSInteger)badge __API_AVAILABLE(macos(10.10), ios(8.0));
395
-
396
388
  + (NSString *)pushwooshVersion;
397
389
 
398
390
  #if TARGET_OS_IOS
@@ -18,7 +18,7 @@
18
18
 
19
19
  #endif
20
20
 
21
- #define PUSHWOOSH_VERSION @"6.3.2"
21
+ #define PUSHWOOSH_VERSION @"6.4.2"
22
22
 
23
23
 
24
24
  @class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
@@ -81,6 +81,11 @@ Tells the delegate that the user has pressed on the push notification banner.
81
81
  */
82
82
  @property (nonatomic, readonly) NSUInteger badge;
83
83
 
84
+ /**
85
+ Extension badge number of the push message.
86
+ */
87
+ @property (nonatomic, readonly) NSUInteger badgeExtension;
88
+
84
89
  /**
85
90
  Remote URL or deeplink from the push message.
86
91
  */
Binary file
Binary file