Skip to content

Commit

Permalink
Release commit 4.1.0
Browse files Browse the repository at this point in the history
* Update Android version to 4.4.1
* Update iOS Version to 3.5.3
* Update Notification Service method
  • Loading branch information
Jeasmine committed Jul 13, 2021
1 parent 2e390bc commit d167e13
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {

// api is used instead of implementation so the parent :app project can access any of the OneSignal Java
// classes if needed. Such as com.onesignal.NotificationExtenderService
api 'com.onesignal:OneSignal:4.4.0'
api 'com.onesignal:OneSignal:4.4.1'

testImplementation 'junit:junit:4.12'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@ - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withConte
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];

[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];

// DEBUGGING: Uncomment the 2 lines below and comment out the one above to ensure this extension is excuting
// Note, this extension only runs when mutable-content is set
// Setting an attachment or action buttons automatically adds this
// NSLog(@"Running NotificationServiceExtension");
// self.bestAttemptContent.body = [@"[Modified] " stringByAppendingString:self.bestAttemptContent.body];

self.contentHandler(self.bestAttemptContent);
[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent withContentHandler:self.contentHandler];
}

- (void)serviceExtensionTimeWillExpire {
Expand Down
2 changes: 1 addition & 1 deletion examples/RNOneSignalTS/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"react": "16.13.1",
"react-native": "0.64.1",
"react-native-onesignal": "4.1.1"
"react-native-onesignal": "4.2.0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
Expand Down
2 changes: 1 addition & 1 deletion ios/RCTOneSignal/RCTOneSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#define INIT_DEPRECATION_NOTICE "Objective-C Initialization of the OneSignal SDK has been deprecated. Use JavaScript init instead."

@interface RCTOneSignal : NSObject <OSSubscriptionObserver, OSEmailSubscriptionObserver, OSPermissionObserver>
@interface RCTOneSignal : NSObject <OSSubscriptionObserver, OSEmailSubscriptionObserver, OSPermissionObserver, OSSMSSubscriptionObserver>

+ (RCTOneSignal *) sharedInstance;

Expand Down
1 change: 1 addition & 0 deletions ios/RCTOneSignal/RCTOneSignalExtensionService.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
@interface RCTOneSignalExtensionService : NSObject
+ (void)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest * _Nonnull)request withMutableNotificationContent:(UNMutableNotificationContent * _Nullable)content;
+ (void)didReceiveNotificationRequest:(UNNotificationRequest * _Nonnull)request withContent:(UNMutableNotificationContent * _Nullable)content;
+ (void)didReceiveNotificationRequest:(UNNotificationRequest * _Nonnull)request withContent:(UNMutableNotificationContent * _Nullable)content withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler;
@end
4 changes: 4 additions & 0 deletions ios/RCTOneSignal/RCTOneSignalExtensionService.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ +(void)didReceiveNotificationRequest:(UNNotificationRequest *)request withConten
[OneSignal didReceiveNotificationExtensionRequest:request withMutableNotificationContent:content];
}

+ (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContent:(UNMutableNotificationContent* _Nullable)content withContentHandler:(void (^)(UNNotificationContent *_Nonnull))contentHandler {
[OneSignal didReceiveNotificationExtensionRequest:request withMutableNotificationContent:content withContentHandler:contentHandler];
}

+(void)serviceExtensionTimeWillExpireRequest:(UNNotificationRequest *)request withMutableNotificationContent:(UNMutableNotificationContent * _Nullable)content {
[OneSignal serviceExtensionTimeWillExpireRequest:request withMutableNotificationContent:content];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-onesignal",
"version": "4.1.1",
"version": "4.2.0",
"description": "React Native OneSignal SDK",
"main": "src/index",
"typings": "src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion react-native-onesignal.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Pod::Spec.new do |s|
# pod 'React', :path => '../node_modules/react-native/'

# The Native OneSignal-iOS-SDK XCFramework from cocoapods.
s.dependency 'OneSignalXCFramework', '3.4.4'
s.dependency 'OneSignalXCFramework', '3.5.3'
end

0 comments on commit d167e13

Please sign in to comment.