Skip to content

Commit 966d072

Browse files
committed
Log Fatal log for null app ID only on native SDK
* Wrapper SDKs will automatically initialize with null app ID. * On wrappers, this fatal log is very misleading, so only log if this happens on the native SDK. * Most wrappers also have type signatures indicating app ID should be non-null for the public initialize API
1 parent d63855d commit 966d072

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ + (void)setAppId:(nullable NSString*)newAppId {
293293

294294
+ (BOOL)isValidAppId:(NSString*)appId {
295295
if (!appId || ![[NSUUID alloc] initWithUUIDString:appId]) {
296-
[OneSignalLog onesignalLog:ONE_S_LL_FATAL message:[NSString stringWithFormat:@"OneSignal AppId: %@ - AppId is null or format is invalid, stopping initialization.\nExample usage: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba'\n", appId]];
296+
if (!OneSignalWrapper.sdkType) {
297+
// Fatal log if not a wrapper SDK, wrappers will call init with null App Id
298+
[OneSignalLog onesignalLog:ONE_S_LL_FATAL message:[NSString stringWithFormat:@"OneSignal AppId: %@ - AppId is null or format is invalid, stopping initialization.\nExample usage: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba'\n", appId]];
299+
}
297300
return false;
298301
}
299302
return true;

0 commit comments

Comments
 (0)