How to add Push Notifications on Cordova iOS application? - plugins

I am following a tutorial on how to enable push notifications in a Cordova project on iOS.
If I use the sample project that the author provided, everything is in place and works.
However I need to use the latest Cordova version so I started to make my own project. The Cordova project is created correctly. The problems start when I try to install the push notifications plugin.
On the tutorial the author says to make some changes to the cordova.plist file but why on earth the .plist file doesn't exist in the latest version of Cordova?
Is there another way to enable the plugin? We don't need the .plist?

I had the exact same problem. Got stuck at the same place. This is what I did
1- Install the Plugin using the CLI - phonegap local plugin add https://github.com/phonegap-build/PushPlugin.git
2- Since i could not find the PLIST adding the code to the AppDelegate.m would just create errors. So i found the following link:
Cordova 2.5.0 - Errors after referencing appDelegate.m to PushPlugin
3- Within the above link there is a sample of an appdelegate.m which i copied and replaced in my code. THis way i dont have to play worry about the plist.
4- I copied the rest of the JS and it worked immediately. Hope this helps.

you managed it how to solve the problem?
you have to make the changes in the config.xml-file
add: plugin
name="PushPlugin" and value="PushPlugin
inside config.xml
then add this to you your AppDelegate.m
https://github.com/hollyschinsky/PhoneGapBuildPushProject2/blob/master/PhoneGapBuildPushApp2/Classes/AppDelegate.m
Hope this was helpful - I'm on the same tutorial but couldn't manage the next step - maybe we could help each other a little

Related

Local notifications not working in Ionic 3

I am new to Ionic 3 and I implemented Local notifications using plugin https://ionicframework.com/docs/native/local-notifications/ and it works just as expected, but every time I push my changes and take a pull again, I need to re-install the plugin and build again.
Any solutions?
Referring to this link, the correct way to install local notification plugin for Ionic 3 is by using ionic cordova plugin add de.appplant.cordova.plugin.local-notification
Most Ionic 3 users have CLI version 3 and above. Hope this help to others too!
As mentioned in the first comment in my question itself, the problem was resolved, so I am closing this topic by posting an answer.
I got the fix, it was this line in my package.json file that was causing the problem:
"cordova-plugin-app-event": "file:node_modules/cordova-plugin-app-event"Changing the path of the plugin fixed the issue.

No such module 'FBAudienceNetwork' in XCode 9 Swift 4

I installed the FBAudienceNetwork (version 4.26.0) with CocoaPods (version 1.3.1). I followed the official manual as published at https://developers.facebook.com/docs/audience-network/ios, but the Xcode still not recognized the framework.
Just to be clear - I opened the project from xcworkspace file.
I tried the following steps with no success:
Install the framework manually, adding the ~/Documents/FacebookSDK path to Framework Search Path
Make sure that the pods project compiled using Swift 4
Added also FBSDKCoreKit (with Bolts) and FBSDKShareKit (both frameworks imported successfully)
Clean the project, delete DerivedData and also clean the pods cache and reinstalling the pods
Nothing worked so far. Anyone faced the same issue and know the reason?
Fixed in v4.27.0
Another solution that uses latest SDK (until Facebook fixes this) is to add a line to your Objc bridging header:
#import <FBAudienceNetwork/FBAudienceNetwork.h>
Of course this assumes you are using a bridging header, and if you're not then you could add one but that defeats the point of using modules. Hopefully Facebook fixes this soon.
I'm also seeing the same problem. I'm watching the Facebook bug report, but it's already been closed so I don't have high hopes of it being fixed anytime soon. Facebook suggested adding "$(SRCROOT)" to your Framework Search Paths as a work around, but it didn't work for me.
For now, I've manually locked my "FBAudienceNetwork" pod to version 4.25.0 with the following line in my Podfile:
pod 'FBAudienceNetwork', '4.25.0'
Try this solution it will fix your issue.
You need to rename FBAudienceNetwork.modulemap to module.modulemap in FBAudienceNetwork.framework/Modules folder.
v4.26
From the audience network installation guide
Good luck
Following this post:
https://developers.facebook.com/bugs/185968218614056/
and after downgrade to version 4.23 (supported by MoPub mediation as written here: https://github.com/mopub/mopub-ios-sdk/wiki/Integrating-Native-Third-Party-Ad-Networks) the integration is working (by adding the framework manually).
This is a bug in 4.26 version, so anyone that encourage the same issue, you have to wait for Facebook fixing this bug. I recommend to subscribe and follow the discussion I posted.
It works when I'm using only the framework within the "static" folder.

Add push notifications to Visual Studio Cordova Project

I tried to follow this article on MSDN magazine enter link description here to add iOS push notifications. However the sample code they provide enter link description here is outdated(using VS2013). I tried to migrate the project to VS2015 by following enter link description here but still cannot get it to work.
Can anyone provide a working sample code in VS2015? Thanks!
You need to configure the notification hub to send notifications to your iOS app.
Here is a sample how to do this in step by step walk-through:
https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-ios-get-started/
Hope this helps.
I've updated the sample to Visual Studio 2015 in my fork: https://github.com/ggailey777/mobile-services-samples/tree/master/CordovaNotificationsArticle
To get it to work, I also needed to add the Whitelist plugin, which is now a requirement to access remote services from a Cordova app.
I am waiting to merge it back into the upstream fork until after I can get it tested on iOS (it does work now on Android). As mostafa points out, you do also need to follow the steps to configure push notification for iOS, which includes doing a bunch of stuff in Xcode on the Mac.

How to use sphero unity plugin?

I'm trying to use sphero unity plugin.
I'm download from GitHub. Evrything is OK but when I'm trying to lauch the sample app from Ipad2 it crashe.
I'm also try with the unity plugin in the asset store.
Did I forget anything ?
Thank you
We are seeing this crash on some projects because the "-all_load" linker flag isn't added in the xcodeproject. See this other stackoverflow project for a more detailed solution.
Sphero iOS Unity Plugin - Crash Following Sphero Connect

Cordova 1.6.1 setInfo error

I recently upgraded to cordova 1.6.1 but i can't get it to deploy on the simulator or the device itself. The debugger shows Error: executing module 'setInfo' are you sure you have loaded iOS version of cordova-1.6.1.js? Though i'm sure i already did. Any help?
Solved it using this link
It turns out if you are using requireJS together with Phonegap or Cordova it can't load properly if you wrap Cordova on a require Call. So the solution would be to add this on your index.html
<script type="text/javascript" charset="utf8" src="[location of cordova.ios(for ios)]"></script>
Also follow the link's solution found at the very bottom.
Did you follow all the steps for the upgrade? Make sure you have the updated Cordova.plist since the plug-in names have changed.
Yes even I had same problem I am using cordova 1.9.0 i was simply coping www folder and didnt replace necessary (ios) version of cordova.js make sure of that u must be good then.
Guideline
Hope this works for you.