ios - How may I trigger banner notifications using FCM? -


how show banners in app using firebase's fcm feature? able receive , show banner notifications via apple provided delegate method:

func usernotificationcenter(_ center: unusernotificationcenter, willpresent notification: unnotification, withcompletionhandler completionhandler: @escaping (unnotificationpresentationoptions) -> void) {   completionhandler([.alert, .badge, .sound]) } 

however, once try use fcm, method no longer called. instead, it's method receives notification information:

extension firebasenotificationmanager: firmessagingdelegate {   func applicationreceivedremotemessage(_ remotemessage: firmessagingremotemessage) {     let appdata = remotemessage.appdata     appdata.foreach { print($0) }   } } 

i can printout of appdata, i'm not sure how display banner alert.

any appreciated!

i using ios 10 , working me.

- (void)usernotificationcenter:(unusernotificationcenter *)center    willpresentnotification:(unnotification *)notification      withcompletionhandler:(void (^)(unnotificationpresentationoptions))completionhandler   {         nsdictionary *userinfo = notification.request.content.userinfo;          // print full message.          nslog(@"%@", userinfo);  // change preferred presentation option       completionhandler(unnotificationpresentationoptionalert);  } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -