diff --git a/PushwooshUnitySample/Assets/Plugins/iOS/UnityRuntime.m b/PushwooshUnitySample/Assets/Plugins/iOS/UnityRuntime.m index 161c91e..3a3c109 100644 --- a/PushwooshUnitySample/Assets/Plugins/iOS/UnityRuntime.m +++ b/PushwooshUnitySample/Assets/Plugins/iOS/UnityRuntime.m @@ -286,11 +286,16 @@ void pw_addBadgeNumber(int deltaBadge) { pw_setBadgeNumber(badge); } -bool pw_isCommunicationEnabled () { +bool pw_isCommunicationEnabled() { if ([[NSUserDefaults standardUserDefaults] objectForKey:KeyIsServerCommunicationEnabled]) { _isServerCommunicationEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:KeyIsServerCommunicationEnabled]; } else { - _isServerCommunicationEnabled = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"Pushwoosh_ALLOW_SERVER_COMMUNICATION"] boolValue]; + id value = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"Pushwoosh_ALLOW_SERVER_COMMUNICATION"]; + if (value && ([value isKindOfClass:[NSNumber class]] || [value isKindOfClass:[NSString class]])) { + _isServerCommunicationEnabled = [value boolValue]; + } else { + _isServerCommunicationEnabled = YES; + } } return _isServerCommunicationEnabled; }