Add push notifications to Visual Studio Cordova Project - azure-mobile-services

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.

Related

Where can I find the latest Movesense Showcase app source?

According to https://www.movesense.com/news/2020/02/movesense-showcase-ios-app-is-now-open-source/ the showcase app source is open source. But the source code that’s there in the repo is at least couple of versions behind in terms of UI.
Is there an updated repo location for the latest? Our client is looking at the app in AppStore thinking the source code should be the same.
Well, the source code in the repository is exactly the same as has been used for generating and compiling the app store version. Could you please make sure you are using the master branch of this repo: https://bitbucket.org/suunto/movesense-mobile-lib/ ?
Also, please make sure that you are opening the folder MovesenseShowcase in xcode, not IOS-example (which is the old example app for iOS)
In addition, please make sure you are using Xcode 11 (latest) and following the instructions in readme.md

Can't link ionic app to ionic pro account

I have a monolith jhispter app and an ionic-jhipster app both working fine together (Thanks to Matt Raible and JHipster team). And I'm not sure if my problem has anything to do with JHipster.
Since I'm working on windows, I thought maybe I'd be better to use Ionic Pro cloud services to build my app for ios and Android. Please correct me if I'm wrong.
Here is the process I went through:
1-I added my Ionic app on GitHub. So, I'm using GitHub as my Source Control
2-I used "ionic ssh setup" command to create SSH public/private keys and I believe it took care of generating the keys and putting them in the right place I guess I didn't have to generate the SSH keys since it could work just by my user name and password too. Is that right?
3-I went to my app's folder and used "ionic link" to link my existing app to my Ionic Pro dashboard
4-In answer to existing app or new app (which was not clear to me what it's asking for), I chose new app since GaëlMarziou helped me in the comments section to understand there should be an app already created in my Ionic Pro so I can link my local app to it. It took me a while so I understood this prompt is asking about the dashboard app not my local app. I chose "new" since it was the first time I was using my Ionic Pro account and I had no app on it.
5-Then it asked about the source control and I chose GitHub and provided the credentials
6-Then it showed me a list of my repositories on GitHub so I can choose one. But before I do anything it just jumped out with no error/success messages. And I considered it done since I had the same names for my app and GitHub repository and I thought maybe it was smart enough to find the correct repository.
Now, I can see an app in my Ionic Pro dashboard but the build and commit history is empty and it looks like the app is not linked yet.
I tried "git push origin master" to build my app when I was in my Ionic app folder. I assume "origin" would work for any git repository, am I right? It tells me everything is up-to-date and nothing happens in my Ionic Pro dashboard.

Add iOS push notifications to Visual Studio Cordova Project

Hi I'm following this tutorial https://github.com/ggailey777/mobile-services-samples/tree/master/CordovaNotificationsArticle
to add iOS push notification to my Cordova project but couldn't get it to work. The APNS certificate is configured and I've uploaded the p12 file to azure mobile notification.
When I run the app it shows "Registered with Azure!" and in azure notification hub I can see the registration.
However when I send test push notification using visual studio, the message result is empty.
If I use azure portal, it shows "The test notification was sent"
And my iphone never got any notifications either when it's open or closed.
Am I missing something? Any help is much appreciated.
Thanks!
You are mixing and matching technologies. You cannot use iOS Native code in an Apache Cordova app. Based on your comments, use the cordova-push-notifications plugin. The README.md in the project describes how to add it for iOS. It's relatively simple.
You will still have to deal with how to get your device registered with Notification Hubs and getting a notification sent to your device. That is covered in detail in the Azure Notification Hubs documentation.

Google Analytic not updated in iOS Cordova 2.0.0 App

I am working on iOS App using Cordova 2.0.0, and I want to use Google Analytics, So I followed this github link step by step, but Unfortunately GA not updated, The only difference that
in the link Readme file "Make sure you are running Cordova(PhoneGap) 1.5.0"
and I use Cordova 2.0.0
but I see that the repo is updated to 2.0.0 and my App is work right but GA not updated
and here it is the code that I call in OnDeviceReady method, to start the GA and add event
var googleAnalytics = window.plugins.googleAnalyticsPlugin;
googleAnalytics.startTrackerWithAccountID("XX-XXXXXXXX-X");
googleAnalytics.trackEvent("category", "action", "label goes here", 666);
Can any one help or face the same problem?
Kindly the follow the below link,its very helpful and also worked for me.
----> https://github.com/jelled/google-analytics-cordova-ios

How to add Push Notifications on Cordova iOS application?

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