Skip to content

Commit 3993880

Browse files
authored
Merge pull request #1214 from OneSignal/5.0.0/expose_set_launch_options
[5.0.0] expose `setLaunchOptions` method for wrapper SDKs
2 parents d849f0d + 3cbbd22 commit 3993880

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,16 @@ + (BOOL)isValidAppId:(NSString*)appId {
321321
1/2 steps in OneSignal init, relying on setAppId (usage order does not matter)
322322
Sets the iOS sepcific app settings
323323
Method must be called to successfully init OneSignal
324+
Note: While this is called via `initialize`, it is also called directly from wrapper SDKs.
324325
*/
325326
+ (void)setLaunchOptions:(nullable NSDictionary*)newLaunchOptions {
326327
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"setLaunchOptions() called with launchOptions: %@!", launchOptions.description]];
327328

329+
// Don't continue if the newLaunchOptions are nil
330+
if (!newLaunchOptions) {
331+
return;
332+
}
333+
328334
launchOptions = newLaunchOptions;
329335

330336
// Cold start from tap on a remote notification

iOS_SDK/OneSignalSDK/Source/OneSignalFramework.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ NS_SWIFT_NAME(login(externalId:token:));
8282
+ (Class<OSNotifications>)Notifications NS_REFINED_FOR_SWIFT;
8383

8484
#pragma mark Initialization
85+
+ (void)setLaunchOptions:(nullable NSDictionary*)newLaunchOptions; // meant for use by wrappers
8586
+ (void)initialize:(nonnull NSString*)newAppId withLaunchOptions:(nullable NSDictionary*)launchOptions;
8687
+ (void)setLaunchURLsInApp:(BOOL)launchInApp;
8788
+ (void)setProvidesNotificationSettingsView:(BOOL)providesView;

0 commit comments

Comments
 (0)