Skip to content

Commit 3e64983

Browse files
committed
Always set test type to 1 for simulators
Cherry-pick of #1244 Our provision detection in OneSignalMobileProvision is not successfully able to find the embedded mobile provision for simulators. This might only affect Xcode managed provisioning profiles. This change is a workaround to that issue to always set testType to 1 since simulators need to receive push in the sandbox environment.
1 parent 6c0cda3 commit 3e64983

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSSubscriptionModel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ class OSSubscriptionModel: OSModel {
218218
// Set test_type if subscription model is PUSH
219219
if type == .push {
220220
let releaseMode: OSUIApplicationReleaseMode = OneSignalMobileProvision.releaseMode()
221+
#if targetEnvironment(simulator)
222+
if (releaseMode == OSUIApplicationReleaseMode.UIApplicationReleaseUnknown) {
223+
self.testType = OSUIApplicationReleaseMode.UIApplicationReleaseDev.rawValue
224+
}
225+
#endif
221226
// Workaround to unsure how to extract the Int value in 1 step...
222227
if releaseMode == .UIApplicationReleaseDev {
223228
self.testType = OSUIApplicationReleaseMode.UIApplicationReleaseDev.rawValue

0 commit comments

Comments
 (0)