0
votes

Environment: MAC EL Capitan 10.11.6 , xCode Version 7.3.1, Node version: v5.5.0, Cordova version: 6.3.1, cordova-plugin-mfp-push 8.0.2016070407, MobileFirst Platform Foundation Command Line Interface (CLI): 8.0.0-2016070716

Question: Why can I not run a cordova app on a real ios device, after the installation of the cordova-mfp-push plugin? The ios app runs in the ios simulator. Who had the same problem and how did you find it?

Backround: I have a cordova app which was working with mfp8 push.

Because of the Apple Certification expiration problem (https://developer.apple.com/support/certificates/expiration/), I had to recreate the certificates.

Problem: After the recreation of the certifications I tried to run the app on my device. But I got the certification error. Based on this I tried to run other Cordova Apps on my iOS device and this was possible.

Based on this finding I decide to add and remove the cordova plugins and check, when will this problem appear.

Finding: My finding is: when I add the cordova-mfp-push plugin, then the problem with the certification appears in xcode.

I guess the reason is the cordova-mfp-push plugin automatically switch on the functionality “Backround Modes -> remote notifications”.

Here you can see the two situations with the ios app:

  1. Before add cordova-mfp-push to the cordova app:

In xCode running app ... ok the MFP push lib can not be found, but this is clear why.

enter image description here

In xCode no additional options enabled

enter image description here

  1. After add cordova-mfp-push to the cordova app:

Console output

IBMs-MBP:MobileClientV3 tsuedbroecker$ cordova plugin add cordova-plugin-mfp-push --save
Fetching plugin "cordova-plugin-mfp-push" via npm
Installing "cordova-plugin-mfp-push" for android
Dependent plugin "cordova-plugin-mfp" already installed on android.
Installing "cordova-plugin-mfp-push" for ios
Dependent plugin "cordova-plugin-mfp" already installed on ios.
Saved plugin info for "cordova-plugin-mfp-push" to config.xml
IBMs-MBP:MobileClientV3 tsuedbroecker$ cordova prepare
Running command: /Users/tsuedbroecker/Documents/tsuedbro/MobileBluemix/dev/mfp8beta/CheckApp/MobileClientV3/hooks/after_prepare/010_add_platform_class.js /Users/tsuedbroecker/Documents/tsuedbro/MobileBluemix/dev/mfp8beta/CheckApp/MobileClientV3
add to body class: platform-android
add to body class: platform-ios
will push strings array {"name":"lang","titles":["English (US)","English (UK)"],"values":["en-us","en-gb"]}
android preferences file was successfully generated
ios settings bundle was successfully generated
IBMs-MBP:MobileClientV3 tsuedbroecker$ cordova plugin list
cordova-plugin-app-preferences 0.99.2 "AppPreferences"
cordova-plugin-camera 2.2.0 "Camera"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-geolocation 2.2.0 "Geolocation"
cordova-plugin-globalization 1.0.3 "Globalization"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-mfp 8.0.2016080320 "IBM MobileFirst Platform Foundation"
cordova-plugin-mfp-push 8.0.2016070407 "IBM MobileFirst Platform Foundation - Push Notifications"
cordova-plugin-okhttp 2.0.0 "OkHttp"
cordova-plugin-spinner-dialog 1.3.1 "SpinnerDialog"

Problem to run on device:

enter image description here

Changed configuration in xCode by the plugin:

enter image description here

1
And if you then tick this option off?Idan Adar
When I tick this option off, it is still the same problem.Thomas Suedbroecker
The issue noted when trying to run on device "Unable to install" does not look to be a cordova mfp push plugin issue. Can you please try running the native iOS push sample on the same device - signed with the same profile and do you see that working? Or does the same error message appear? If so, it could be a problem with certificates not being updatedVivin K
So, I did download the github.com/MobileFirst-Platform-Developer-Center/… sample. Setup the certifications. Configure existing MFP8 Server on BX. And the sample runs on my device and I can send push from the MFP server to my device. ... no problem with the swift sampleThomas Suedbroecker
I copy my mobile project and renamed the cordova app new bundle ID, create new certifications, add to mfp server ... still the same problem. The problem only comes up, when the cordova-plugin-mfp-push is added.Thomas Suedbroecker

1 Answers

0
votes

I guess something was broken in my old cordova project.

Thanks to @Idan Adar and @Vivin K for their feedback.

I did following steps to get the cordova app running on ios device with push again.

  1. I did the sample with cordova on github.com/MobileFirst-Platform-Developer-Center/… . This sample works.

  2. I added all my needed plugins to the copy of the working cordova push project:

    IBMs-MBP:MobileClientV4 tsuedbroecker$ ./add-cordova-plugins.sh --> Starting add cordova plugins ****** app-preferences ********* Fetching plugin "cordova-plugin-app-preferences" via npm Installing "cordova-plugin-app-preferences" for ios app-settings.json not found: creating a sample file Saved plugin info for "cordova-plugin-app-preferences" to config.xml ****** camera ********* Fetching plugin "cordova-plugin-camera" via npm Installing "cordova-plugin-camera" for ios Fetching plugin "cordova-plugin-compat" via npm Installing "cordova-plugin-compat" for ios Saved plugin info for "cordova-plugin-camera" to config.xml ****** compat ********* Plugin "cordova-plugin-compat" already installed on ios. Making it top-level. Saved plugin info for "cordova-plugin-compat" to config.xml ****** console ********* Fetching plugin "cordova-plugin-console" via npm Installing "cordova-plugin-console" for ios Saved plugin info for "cordova-plugin-console" to config.xml ****** device ********* Plugin "cordova-plugin-device" already installed on ios. Making it top-level. Saved plugin info for "cordova-plugin-device" to config.xml ****** dialogs ********* Plugin "cordova-plugin-dialogs" already installed on ios. Making it top-level. Saved plugin info for "cordova-plugin-dialogs" to config.xml ****** geolocation ********* Fetching plugin "cordova-plugin-geolocation" via npm Installing "cordova-plugin-geolocation" for ios Dependent plugin "cordova-plugin-compat" already installed on ios. Saved plugin info for "cordova-plugin-geolocation" to config.xml ****** globalization ********* Plugin "cordova-plugin-globalization" already installed on ios. Making it top-level. Saved plugin info for "cordova-plugin-globalization" to config.xml ****** inappbrowser ********* Fetching plugin "cordova-plugin-inappbrowser" via npm Installing "cordova-plugin-inappbrowser" for ios Saved plugin info for "cordova-plugin-inappbrowser" to config.xml ****** spinner-dialog********* Fetching plugin "cordova-plugin-spinner-dialog" via npm Installing "cordova-plugin-spinner-dialog" for ios Saved plugin info for "cordova-plugin-spinner-dialog" to config.xml ****** okhttp ********* Fetching plugin "cordova-plugin-okhttp" via npm Installing "cordova-plugin-okhttp" for ios Saved plugin info for "cordova-plugin-okhttp" to config.xml ****** list cordova plugins ********* cordova-plugin-app-preferences 0.99.2 "AppPreferences" cordova-plugin-camera 2.2.0 "Camera" cordova-plugin-compat 1.0.0 "Compat" cordova-plugin-console 1.0.3 "Console" cordova-plugin-device 1.1.2 "Device" cordova-plugin-dialogs 1.2.1 "Notification" cordova-plugin-geolocation 2.2.0 "Geolocation" cordova-plugin-globalization 1.0.3 "Globalization" cordova-plugin-inappbrowser 1.4.0 "InAppBrowser" cordova-plugin-mfp 8.0.2016080320 "IBM MobileFirst Platform Foundation" cordova-plugin-mfp-push 8.0.2016070407 "IBM MobileFirst Platform Foundation - Push Notifications" cordova-plugin-okhttp 2.0.0 "OkHttp" cordova-plugin-spinner-dialog 1.3.1 "SpinnerDialog" cordova-plugin-splashscreen 3.2.2 "Splashscreen" cordova-plugin-whitelist 1.2.2 "Whitelist" ****** cordova prepare ********* ios settings bundle was successfully generated --> Add cordova plugins DONE!

  3. I copied the www and resource folder from my old project into the working cordova project.

  4. I copied the Ionic project file also to from my old project into the working cordova project.

  5. That is the result:

********* Steps ***********

  1. Step -> start app from xCode

enter image description here

  1. Step -> go to configure push

enter image description here

  1. Step -> check push support

enter image description here

  1. Step -> register device

enter image description here

  1. Step -> send push from mfp server to registered mobile devices

enter image description here