Closed yangyang-wen closed 10 months ago
Hi @yangyang-wen, could you provide some additional details on which iOS versions your app supports as well as how you are requesting the push permissions? To note, there are some distinctions in our integration docs around iOS 10+ and pre-iOS 10 push registration. Could you verify if your implementation matches those steps accordingly?
Hey @jerielng , our app supports iOS14-iOS16. we request push permissions use this.
let center = UNUserNotificationCenter.current()
let options: UNAuthorizationOptions = [.alert, .sound, .badge]
center.requestAuthorization(options: options) { granted, _ in
Appboy.sharedInstance()?.pushAuthorization(fromUserNotificationCenter: granted)
}
I pod install v4.1.0, Push notfication is OK, but after version, won't display the push notfication Box.
Hey @yangyang-wen, I'm having difficulty reproducing this issue from our end. Are you able to step through the authorization request process and noticing where in your code it might be failing/not being triggered? Is there also anything else you can share about how you are implementing the notification handlers in your app that might help shed light on the issue?
My registration logic is the same as 4.1.0, the difference is that when I install pod 'Appboy-iOS-SDK '4.5.4 when I install for the first time, I will not play the push message box. When I switch to pod 'Appboy-iOS-SDK '4.1.0, this message pops up. The specific screen recording is as follows:
4.5.4 There is no push box
https://github.com/Appboy/appboy-ios-sdk/assets/127808028/9a0b95dd-cd31-464a-a2ad-348a961a43a1
4.1.0 There has a push box
https://github.com/Appboy/appboy-ios-sdk/assets/127808028/9bc0a07d-8e09-4a66-9372-17db29b492ec
Hi @yangyang-wen, as a minimal reproducible scenario, that method call center.requestAuthorization
should be all you need to display the push permissions dialog box. For context, the display of this prompt is managed by the iOS UserNotifications framework, and an upgrade to the Braze SDK shouldn't have consequences for this display. The Braze logic (Appboy.sharedInstance()?.pushAuthorization(fromUserNotificationCenter: granted)
) is only executed after the push permissions have been accepted.
For a sanity check, can you cross-reference our sample app, which has a working example?
Additionally, we would recommend setting a breakpoint in your push registration code to determine where it's getting stopped and why it may not be getting triggered.
If the above doesn't work, could you write in to our support team at support@braze.com with further details on this case and a link to this GitHub issue for context?
Thanks @jerielng , I will cross-reference your sample app, when I finished, I will let you know.
Has solved.
Thanks for getting back to us. I'll close out this issue since it has been solved.
Platform
iOS
Platform Version
iOS 16.4
Braze SDK Version
4.5.4
Xcode Version
Xcode 14.3.1
Integration Method
Cocoapods
Computer Processor
Apple (M1)
Repro Rate
100%
Steps To Reproduce
pod 'Appboy-iOS-SDK'
4.5.4 to the Podspec file.[Appboy startWithApiKey:inApplication:withLaunchOptions:];
application:didFinishLaunchingWithOptions:
method inAppDelegate.m
.Expected Behavior
push dialog box should displayed, send messages should have push notification
Actual Incorrect Behavior
When pod installing 4.1.0, the push box will pop up and push notifications will be received, but not after 4.1.0
Verbose Logs
No response
Additional Information
No response