1

I'm using testflight for betatesting my app and Firebase messaging to sends notifications.

When a notification sent, the user with the specified token, received it but by tapping on the notification badge the related page in app doesn't appear. Like the didReceiveRemoteNotification is not called.

I tested notifications on mobiles before, by running the app directly on them and it worked fine.

I changed Debug provisioning profile to Distribution And in Firebase changed APNs Authentication Key method to APNs Certificates but it doesn't work yet.

This is AppDelegate. appdelegate

Negar Moshtaghi
  • 463
  • 1
  • 6
  • 21
  • Did you check this thread? https://stackoverflow.com/questions/24044298/why-push-notifications-is-not-working-on-testflight Seems like you need to use production push certificate for testflight build. Generate one on https://developer.apple.com – balazs630 May 03 '19 at 20:57
  • @balazs630 yes I checked, I used production push certificate and the notification received but doesn't work. – Negar Moshtaghi May 04 '19 at 13:26

1 Answers1

1

I think you didn't check authorization in app delegate didFinishLaunchingWithOptions.

UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
    options: authOptions) { (accepted, error) in
        if !accepted{
            CLog.i("Notification not accepted!")
        }
}
UIApplication.shared.registerForRemoteNotifications()
Alireza12t
  • 377
  • 1
  • 4
  • 14