Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-kids-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-push-info': minor
---

Fix for returning the wrong APNs environment on TestFlight
11 changes: 10 additions & 1 deletion packages/react-native-push-info/ios/PushInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ class PushInfo: NSObject {

@objc
func constantsToExport() -> [String: Any]! {
#if targetEnvironment(simulator)
let apnsEnvironment = "development"
#else
var apnsEnvironment = embeddedProvision?.entitlements.apsEnvironment?.rawValue
if apnsEnvironment == nil {
let isTestFlight = Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
apnsEnvironment = isTestFlight ? "production" : "development"
}
#endif
return ["bundleId": Bundle.main.bundleIdentifier as Any,
"teamId": embeddedProvision?.entitlements.teamId as Any,
"apnsEnvironment": embeddedProvision?.entitlements.apsEnvironment?.rawValue as Any]
"apnsEnvironment": apnsEnvironment as Any]
}
}
Loading