Skip to content

Commit 43ddc9b

Browse files
author
Rodrigo Gomez Palacio
authored
3.6.0 Release Commit (#914)
1 parent 31d9266 commit 43ddc9b

File tree

4 files changed

+104
-69
lines changed

4 files changed

+104
-69
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424

2525
// api is used instead of implementation so the parent :app project can access any of the OneSignal Java
2626
// classes if needed. Such as com.onesignal.NotificationExtenderService
27-
api 'com.onesignal:OneSignal:3.12.2'
27+
api 'com.onesignal:OneSignal:3.12.3'
2828

2929
testImplementation 'junit:junit:4.12'
3030
}

ios/OneSignal.h

Lines changed: 102 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
/**
2-
* Modified MIT License
3-
*
4-
* Copyright 2017 OneSignal
5-
*
6-
* Permission is hereby granted, free of charge, to any person obtaining a copy
7-
* of this software and associated documentation files (the "Software"), to deal
8-
* in the Software without restriction, including without limitation the rights
9-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
* copies of the Software, and to permit persons to whom the Software is
11-
* furnished to do so, subject to the following conditions:
12-
*
13-
* 1. The above copyright notice and this permission notice shall be included in
14-
* all copies or substantial portions of the Software.
15-
*
16-
* 2. All copies of substantial portions of the Software may only be used in connection
17-
* with services provided by OneSignal.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25-
* THE SOFTWARE.
2+
Modified MIT License
3+
4+
Copyright 2017 OneSignal
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
1. The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
2. All copies of substantial portions of the Software may only be used in connection
17+
with services provided by OneSignal.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
THE SOFTWARE.
2626
*/
2727

28-
/***
29-
28+
/**
3029
### Setting up the SDK ###
3130
Follow the documentation from https://documentation.onesignal.com/docs/ios-sdk-setupto setup OneSignal in your app.
3231
@@ -40,8 +39,7 @@
4039
4140
### More ###
4241
iOS Push Cert: https://documentation.onesignal.com/docs/generating-an-ios-push-certificate
43-
44-
***/
42+
*/
4543

4644
#import <Foundation/Foundation.h>
4745
#import <UserNotifications/UserNotifications.h>
@@ -68,27 +66,6 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {
6866
OSNotificationDisplayTypeNotification
6967
};
7068

71-
@interface OSInAppMessageAction : NSObject
72-
73-
// The action name attached to the IAM action
74-
@property (strong, nonatomic, nullable) NSString *clickName;
75-
76-
// The URL (if any) that should be opened when the action occurs
77-
@property (strong, nonatomic, nullable) NSURL *clickUrl;
78-
79-
// Whether or not the click action is first click on the IAM
80-
@property (nonatomic) BOOL firstClick;
81-
82-
// Whether or not the click action dismisses the message
83-
@property (nonatomic) BOOL closesMessage;
84-
85-
@end
86-
87-
@protocol OSInAppMessageDelegate <NSObject>
88-
@optional
89-
- (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:));
90-
@end
91-
9269
@interface OSNotificationAction : NSObject
9370

9471
/* The type of the notification action */
@@ -99,9 +76,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {
9976

10077
@end
10178

102-
103-
// #### Notification Payload Received Object
104-
79+
/* Notification Payload Received Object */
10580
@interface OSNotificationPayload : NSObject
10681

10782
/* Unique Message Identifier */
@@ -174,7 +149,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {
174149

175150
@end
176151

177-
// ## OneSignal OSNotification
152+
/* OneSignal OSNotification */
178153
@interface OSNotification : NSObject
179154

180155
/* Notification Payload */
@@ -204,7 +179,6 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {
204179

205180
@end
206181

207-
208182
@interface OSNotificationOpenedResult : NSObject
209183

210184
@property(readonly)OSNotification* notification;
@@ -215,6 +189,57 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {
215189

216190
@end;
217191

192+
@interface OSInAppMessageAction : NSObject
193+
194+
/* The action name attached to the IAM action */
195+
@property (strong, nonatomic, nullable) NSString *clickName;
196+
197+
/* The URL (if any) that should be opened when the action occurs */
198+
@property (strong, nonatomic, nullable) NSURL *clickUrl;
199+
200+
/* Whether or not the click action is first click on the IAM */
201+
@property (nonatomic) BOOL firstClick;
202+
203+
/* Whether or not the click action dismisses the message */
204+
@property (nonatomic) BOOL closesMessage;
205+
206+
@end
207+
208+
@protocol OSInAppMessageDelegate <NSObject>
209+
@optional
210+
- (void)handleMessageAction:(OSInAppMessageAction * _Nonnull)action NS_SWIFT_NAME(handleMessageAction(action:));
211+
@end
212+
213+
/* OneSignal Session Types */
214+
typedef NS_ENUM(NSUInteger, Session) {
215+
DIRECT,
216+
INDIRECT,
217+
UNATTRIBUTED,
218+
DISABLED
219+
};
220+
221+
@interface OSOutcomeEvent : NSObject
222+
223+
// Session enum (DIRECT, INDIRECT, UNATTRIBUTED, or DISABLED) to determine code route and request params
224+
@property (nonatomic) Session session;
225+
226+
// Notification ids for the current session
227+
@property (strong, nonatomic, nullable) NSArray *notificationIds;
228+
229+
// Id or name of the event
230+
@property (strong, nonatomic, nonnull) NSString *name;
231+
232+
// Time of the event occurring
233+
@property (strong, nonatomic, nonnull) NSNumber *timestamp;
234+
235+
// A weight to attach to the outcome name
236+
@property (strong, nonatomic, nonnull) NSDecimalNumber *weight;
237+
238+
// Convert the object into a NSDictionary
239+
- (NSDictionary * _Nonnull)jsonRepresentation;
240+
241+
@end
242+
218243

219244
typedef NS_ENUM(NSInteger, OSNotificationPermission) {
220245
// The user has not yet made a choice regarding whether your app can show notifications.
@@ -308,6 +333,7 @@ typedef NS_ENUM(NSInteger, OSNotificationPermission) {
308333

309334
typedef void (^OSWebOpenURLResultBlock)(BOOL shouldOpen);
310335

336+
/*Block for generic results on success and errors on failure*/
311337
typedef void (^OSResultSuccessBlock)(NSDictionary* result);
312338
typedef void (^OSFailureBlock)(NSError* error);
313339

@@ -323,6 +349,10 @@ typedef void (^OSHandleNotificationActionBlock)(OSNotificationOpenedResult * res
323349
/*Block for handling user click on an in app message*/
324350
typedef void (^OSHandleInAppMessageActionClickBlock)(OSInAppMessageAction* action);
325351

352+
/*Block for handling outcome event being sent successfully*/
353+
typedef void (^OSSendOutcomeSuccess)(OSOutcomeEvent* outcome);
354+
355+
326356
/*Dictionary of keys to pass alongside the init settings*/
327357

328358
/*Let OneSignal directly prompt for push notifications on init*/
@@ -350,8 +380,6 @@ extern NSString * const kOSSettingsKeyInFocusDisplayOption;
350380
*/
351381
extern NSString * const kOSSettingsKeyProvidesAppNotificationSettings;
352382

353-
354-
355383
// ======= OneSignal Class Interface =========
356384
@interface OneSignal : NSObject
357385

@@ -362,10 +390,10 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
362390
};
363391

364392

365-
/**
393+
/*
366394
Initialize OneSignal.
367395
Sends push token to OneSignal so you can later send notifications.
368-
*/
396+
*/
369397

370398
// - Initialization
371399
+ (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId;
@@ -396,7 +424,7 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
396424

397425
// - Logging
398426
+ (void)setLogLevel:(ONE_S_LOG_LEVEL)logLevel visualLevel:(ONE_S_LOG_LEVEL)visualLogLevel;
399-
+ (void) onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString*)message;
427+
+ (void)onesignal_Log:(ONE_S_LOG_LEVEL)logLevel message:(NSString*)message;
400428

401429
// - Tagging
402430
+ (void)sendTag:(NSString*)key value:(NSString*)value onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;
@@ -466,30 +494,37 @@ typedef void (^OSEmailSuccessBlock)();
466494
// Email Auth Token is a (recommended) optional parameter that should *NOT* be generated on the client.
467495
// For security purposes, the emailAuthToken should be generated by your backend server.
468496
// If you do not have a backend server for your application, use the version of thge setEmail: method without an emailAuthToken parameter.
497+
+ (void)setEmail:(NSString * _Nonnull)email withEmailAuthHashToken:(NSString * _Nullable)hashToken;
469498
+ (void)setEmail:(NSString * _Nonnull)email withEmailAuthHashToken:(NSString * _Nullable)hashToken withSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock;
470499

471500
// Sets email without an authentication token
501+
+ (void)setEmail:(NSString * _Nonnull)email;
472502
+ (void)setEmail:(NSString * _Nonnull)email withSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock;
473503

474504
// Logs the device out of the current email.
505+
+ (void)logoutEmail;
475506
+ (void)logoutEmailWithSuccess:(OSEmailSuccessBlock _Nullable)successBlock withFailure:(OSEmailFailureBlock _Nullable)failureBlock;
476507

477-
//convenience - no completion blocks
478-
+ (void)logoutEmail;
479-
+ (void)setEmail:(NSString * _Nonnull)email;
480-
+ (void)setEmail:(NSString * _Nonnull)email withEmailAuthHashToken:(NSString * _Nullable)hashToken;
481508

482-
// In App Messaging Trigger methods
509+
// External user id
510+
+ (void)setExternalUserId:(NSString * _Nonnull)externalId;
511+
+ (void)removeExternalUserId;
512+
513+
// In-App Messaging triggers
483514
+ (void)addTrigger:(NSString * _Nonnull)key withValue:(id _Nonnull)value;
484515
+ (void)addTriggers:(NSDictionary<NSString *, id> * _Nonnull)triggers;
485516
+ (void)removeTriggerForKey:(NSString * _Nonnull)key;
486517
+ (void)removeTriggersForKeys:(NSArray<NSString *> * _Nonnull)keys;
487518
+ (NSDictionary<NSString *, id> * _Nonnull)getTriggers;
488519
+ (id _Nullable)getTriggerValueForKey:(NSString * _Nonnull)key;
489520

490-
+ (void)setExternalUserId:(NSString * _Nonnull)externalId;
491-
+ (void)removeExternalUserId;
492-
521+
// Outcome Events
522+
+ (void)sendOutcome:(NSString * _Nonnull)name;
523+
+ (void)sendOutcome:(NSString * _Nonnull)name onSuccess:(OSSendOutcomeSuccess _Nullable)success;
524+
+ (void)sendUniqueOutcome:(NSString * _Nonnull)name;
525+
+ (void)sendUniqueOutcome:(NSString * _Nonnull)name onSuccess:(OSSendOutcomeSuccess _Nullable)success;
526+
+ (void)sendOutcomeWithValue:(NSString * _Nonnull)name value:(NSNumber * _Nonnull)value;
527+
+ (void)sendOutcomeWithValue:(NSString * _Nonnull)name value:(NSNumber * _Nonnull)value onSuccess:(OSSendOutcomeSuccess _Nullable)success;
493528
@end
494529

495530
#pragma clang diagnostic pop

ios/libOneSignal.a

6.24 MB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-onesignal",
3-
"version": "3.5.0",
3+
"version": "3.6.0",
44
"description": "React Native OneSignal SDK",
55
"main": "index",
66
"scripts": {

0 commit comments

Comments
 (0)