Skip to content

Commit

Permalink
Pushwoosh React Native Plugin 6.1.31
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins CI committed May 28, 2024
1 parent 29b8eba commit c231272
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pushwoosh-react-native-plugin",
"version": "6.1.30",
"version": "6.1.31",
"description": "This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).",
"main": "index.js",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion pushwoosh-react-native-plugin.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "pushwoosh-react-native-plugin"
s.version = "6.1.30"
s.version = "6.1.31"
s.summary = "React Native Pushwoosh Push Notifications module"
s.requires_arc = true
s.author = 'Pushwoosh'
Expand Down
2 changes: 1 addition & 1 deletion src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
}

ext {
pushwoosh = "6.7.4"
pushwoosh = "6.7.8"
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion src/ios/PWMessaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

#if TARGET_OS_IOS
#import "PWAppDelegate.h"
#import "PWNotificationExtensionManager.h"
#import "PWRichMediaManager.h"
#import "PWRichMediaStyle.h"
#import "PWInbox.h"
#import "PWInlineInAppView.h"
#import "PWNotificationExtensionManager.h"
#endif
9 changes: 6 additions & 3 deletions src/ios/PWNotificationExtensionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ NS_ASSUME_NONNULL_BEGIN
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
[[PWNotificationExtensionManager sharedManager] handleNotificationRequest:request withAppGroups:@"group.com.example_domain.example_app_name."];
[[PWNotificationExtensionManager sharedManager] handleNotificationRequest:request
withAppGroups:@"group.com.example_domain.example_app_name"
contentHandler:contentHandler];
}
@endcode
*/
- (void)handleNotificationRequest:(UNNotificationRequest *)request withAppGroups:(NSString * _Nullable)appGroupsName;

- (void)handleNotificationRequest:(UNNotificationRequest *)request
withAppGroups:(NSString * _Nonnull)appGroupsName
contentHandler:(void (^ _Nonnull)(UNNotificationContent * _Nonnull))contentHandler;
@end

NS_ASSUME_NONNULL_END
22 changes: 22 additions & 0 deletions src/ios/PushNotificationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,28 @@ typedef void (^PushwooshErrorHandler)(NSError *error);
*/
+ (NSDictionary *)appendValuesToListTag:(NSArray<NSString *> *)array;


/**
Creates a dictionary for removing Tag’s values from existing values list
Example:
@code
NSDictionary *tags = @{
@"Alias" : aliasField.text,
@"FavNumber" : @([favNumField.text intValue]),
@"List" : [PWTags removeValuesFromListTag:@[ @"Item1" ]]
};
[[PushNotificationManager pushManager] setTags:tags];
@endcode
@param array Array of values to be removed from the tag.
@return Dictionary to be sent as the value for the tag
*/
+ (NSDictionary *)removeValuesFromListTag:(NSArray<NSString *> *)array;

@end

/**
Expand Down
56 changes: 55 additions & 1 deletion src/ios/Pushwoosh.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#endif

#define PUSHWOOSH_VERSION @"6.5.8"
#define PUSHWOOSH_VERSION @"6.5.11"


@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Expand Down Expand Up @@ -243,6 +243,13 @@ Tells the delegate that the user has pressed on the push notification banner.
- (void)registerForPushNotifications;
- (void)registerForPushNotificationsWithCompletion:(PushwooshRegistrationHandler _Nullable )completion;

/**
Registers for push notifications with custom tags. By default registeres for "UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert" flags.
Automatically detects if you have "newsstand-content" in "UIBackgroundModes" and adds "UIRemoteNotificationTypeNewsstandContentAvailability" flag.
*/
- (void)registerForPushNotificationsWith:(NSDictionary * _Nonnull)tags;
- (void)registerForPushNotificationsWith:(NSDictionary * _Nonnull)tags completion:(PushwooshRegistrationHandler _Nullable )completion;

/**
Unregisters from push notifications.
*/
Expand Down Expand Up @@ -513,6 +520,32 @@ Unregisters from push notifications.
- (BOOL)handleOpenURL:(NSURL * _Nonnull)url;
#endif

/**
Sends push to start live activity token to the server.
Call this method when you want to initiate live activity via push notification
Example:
@code
if #available(iOS 17.2, *) {
Task {
for await data in Activity<LiveActivityAttributes>.pushToStartTokenUpdates {
let token = data.map { String(format: "%02x", $0) }.joined()
do {
try await Pushwoosh.sharedInstance().sendPush(toStartLiveActivityToken: token)
} catch {
print("Error sending push to start live activity: \(error)")
}
}
}
}
@endcode
*/

- (void)sendPushToStartLiveActivityToken:(NSString *_Nullable)token;
- (void)sendPushToStartLiveActivityToken:(NSString *_Nullable)token completion:(void (^ _Nullable)(NSError * _Nullable))completion;

/**
Sends live activity token to the server.
Call this method when you create a live activity.
Expand Down Expand Up @@ -627,4 +660,25 @@ Unregisters from push notifications.
*/
+ (NSDictionary * _Nullable)appendValuesToListTag:(NSArray<NSString *> * _Nonnull)array;

/**
Creates a dictionary for removing Tag’s values from existing values list
Example:
@code
NSDictionary *tags = @{
@"Alias" : aliasField.text,
@"FavNumber" : @([favNumField.text intValue]),
@"List" : [PWTags removeValuesFromListTag:@[ @"Item1" ]]
};
[[PushNotificationManager pushManager] setTags:tags];
@endcode
@param array Array of values to be removed from the tag.
@return Dictionary to be sent as the value for the tag
*/
+ (NSDictionary * _Nullable)removeValuesFromListTag:(NSArray<NSString *> * _Nonnull)array;

@end
Binary file modified src/ios/libPushwoosh.a
Binary file not shown.

0 comments on commit c231272

Please sign in to comment.