Skip to content

Commit

Permalink
Merge pull request #1017 from OneSignal/react_native_release_3.9.0
Browse files Browse the repository at this point in the history
Release commit for React-Native 3.9.0
  • Loading branch information
mikechoch authored Jul 8, 2020
2 parents 545521f + 41affbe commit a926dd9
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 7 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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:3.14.1'
api 'com.onesignal:OneSignal:3.15.1'

testImplementation 'junit:junit:4.12'
}
Expand Down
81 changes: 77 additions & 4 deletions ios/OneSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,50 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {

@end;

@interface OSInAppMessageOutcome : NSObject

@property (strong, nonatomic, nonnull) NSString *name;
@property (strong, nonatomic, nonnull) NSNumber *weight;
@property (nonatomic) BOOL unique;

// Convert the class into a NSDictionary
- (NSDictionary *_Nonnull)jsonRepresentation;

@end

@interface OSInAppMessageTag : NSObject

@property (strong, nonatomic, nullable) NSDictionary *tagsToAdd;
@property (strong, nonatomic, nullable) NSArray *tagsToRemove;

// Convert the class into a NSDictionary
- (NSDictionary *_Nonnull)jsonRepresentation;

@end

@interface OSInAppMessageAction : NSObject

/* The action name attached to the IAM action */
// The action name attached to the IAM action
@property (strong, nonatomic, nullable) NSString *clickName;

/* The URL (if any) that should be opened when the action occurs */
// The URL (if any) that should be opened when the action occurs
@property (strong, nonatomic, nullable) NSURL *clickUrl;

/* Whether or not the click action is first click on the IAM */
// Whether or not the click action is first click on the IAM
@property (nonatomic) BOOL firstClick;

/* Whether or not the click action dismisses the message */
// Whether or not the click action dismisses the message
@property (nonatomic) BOOL closesMessage;

// The outcome to send for this action
@property (strong, nonatomic, nullable) NSArray<OSInAppMessageOutcome *> *outcomes;

// The tags to send for this action
@property (strong, nonatomic, nullable) OSInAppMessageTag *tags;

// Convert the class into a NSDictionary
- (NSDictionary *_Nonnull)jsonRepresentation;

@end

@protocol OSInAppMessageDelegate <NSObject>
Expand Down Expand Up @@ -335,6 +365,48 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {

@end

@interface OSDevice : NSObject
/**
* Get the app's notification permission
* @return false if the user disabled notifications for the app, otherwise true
*/
- (BOOL)isNotificationEnabled;
/**
* Get whether the user is subscribed to OneSignal notifications or not
* @return false if the user is not subscribed to OneSignal notifications, otherwise true
*/
- (BOOL)isUserSubscribed;
/**
* Get whether the user is subscribed
* @return true if isNotificationEnabled, isUserSubscribed, getUserId and getPushToken are true, otherwise false
*/
- (BOOL)isSubscribed;
/**
* Get the user notification permision status
* @return OSNotificationPermission
*/
- (OSNotificationPermission)getNotificationPermissionStatus;
/**
* Get user id from registration (player id)
* @return user id if user is registered, otherwise false
*/
- (NSString*)getUserId;
/**
* Get apple deice push token
* @return push token if available, otherwise null
*/
- (NSString*)getPushToken;
/**
* Get the user email id
* @return email id if user address was registered, otherwise null
*/
- (NSString*)getEmailUserId;
/**
* Get the user email
* @return email address if set, otherwise null
*/
- (NSString*)getEmailAddress;
@end

typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen);

Expand Down Expand Up @@ -451,6 +523,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
+ (void)IdsAvailable:(OSIdsAvailableBlock)idsAvailableBlock __deprecated_msg("Please use getPermissionSubscriptionState or addSubscriptionObserver and addPermissionObserver instead.");

+ (OSPermissionSubscriptionState*)getPermissionSubscriptionState;
+ (OSDevice*)getUserDevice;

+ (void)addPermissionObserver:(NSObject<OSPermissionObserver>*)observer;
+ (void)removePermissionObserver:(NSObject<OSPermissionObserver>*)observer;
Expand Down
Binary file modified ios/libOneSignal.a
Binary file not shown.
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": "3.8.1",
"version": "3.9.0",
"description": "React Native OneSignal SDK",
"main": "index",
"scripts": {
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 from cocoapods.
s.dependency 'OneSignal', '2.14.2'
s.dependency 'OneSignal', '2.14.3'
end

0 comments on commit a926dd9

Please sign in to comment.