Search code examples
iosfirebasepush-notificationfirebase-cloud-messagingfirebase-console

IOS - FCM Push Notification not received from firebase console


I have a native ios application and it enabled FCM. I have uploaded certificate to firebase and added GoogleService-Info.plist to my project from appdelegate

 -(void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    [FIRMessaging messaging].APNSToken = deviceToken;

    NSLog(@"FCM deviceToken : %@", deviceToken);
}

And I have received token "FCM deviceToken : <076bc1b2 31493038 08da0351 8d272982 d04f7171 46f6e619 31e89403 1457fc19>"

I have tried with this token in console, but it's showing failed.

enter image description hereThis is what i am getting from firebase console


Solution

  • hi @Anju You need to use

    -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken (NSData *)deviceToken{
    [FIRMessaging messaging].APNSToken = deviceToken;NSString *fcmToken = [FIRMessaging messaging].FCMToken;
    NSLog(@"FCM deviceToken : %@", deviceToken);
    }
    

    FCMtoken