Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement Push Notifications in cordova iOS application

I have followed the below steps

My cordova app version is 3.9.2

As per this tutorial https://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1

I have generated provisionals, certificates and pem file. After that started on installation of push notification plugin

  1. Installing Push notification plugin

    cordova plugin add phonegap-plugin-push --variable SENDER_ID="JYOSHNASENDER"
    

While installing a plugin, shows a warning message.

Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.9.2, failed version requirement: >=4.0.0 Skipping 'phonegap-plugin-push' for ios

So, As per this message i have upgraded my platform through this command

cordova platform update ios@ 4.0.1

After this, When i'm trying to build the app on device am getting error in MainViewController.h file

No visible @interface for 'CDVViewController' declares the selector 'webviewdidiFinishLoad:'

Note: Shall i need to add didReceiveRemoteNotification method for cordova ios project.

Please let me know how to resolve the issue.

like image 441
Jyoshna Avatar asked Mar 12 '23 21:03

Jyoshna


1 Answers

There is a known cordova-ios issue where the cordova platform update command does not work correctly under the covers and then when you build the updated project you will get the No visible @interface for 'CDVViewController' declares the selector 'webviewdidiFinishLoad:' error (see here for details: https://issues.apache.org/jira/browse/CB-9254). The workaround is to remove the ios platform, then add it back, rather than updating it in place. So:

cordova platform rm ios
cordova platform add [email protected]

and then add the plugin:

cordova plugin add phonegap-plugin-push --variable SENDER_ID="JYOSHNASENDER"
like image 120
Mike Dailor Avatar answered Mar 15 '23 22:03

Mike Dailor