Firebase notification on cordova ios

138 views
Skip to first unread message

jesus

unread,
Mar 13, 2017, 3:22:26 PM3/13/17
to Firebase Google Group

Hi all,


I'm trying to add firebase notifications on cordova app ios but i can't. This are the steps i've done:


1-created the firebase project 


2-copy the configuration file Googleservice-info.plist 


3-install cordova plugin fcm 


4-add this code in file index.js


window.FirebasePlugin.grantPermission();


    FCMPlugin.onNotification(function(data){
        if(data.wasTapped){
          //Notification was received on device tray and tapped by the user.
          console.log( JSON.stringify(data) );
        }else{
          //Notification was received in foreground. Maybe the user needs to be notified.
          console.log( JSON.stringify(data) );
        }
    });

    FCMPlugin.subscribeToTopic(topicSub);


5-installed cocoapods 


6-executed this command:


pod init


7-in file PodFile i've inserted this code:


pod Firebase/Core

pod 'Firebase/Messaging'


8-installed pod with this comand:


pod install


10-open the project with .xcworkspace file


Now xcode return me this errors:


diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.


What's wrong?

Reply all
Reply to author
Forward
0 new messages