Showing posts with label Visual Studio Cordova. Show all posts
Showing posts with label Visual Studio Cordova. Show all posts

Tuesday, November 3, 2015

Change Azure mobile service Cordova library for windows 10 wns


I encountered this problem: https://github.com/Azure/azure-mobile-services-cordova/issues/8#issuecomment-151245833 , that I could not use the existing azure mobile service js library for wns registration to build cordova app on windows 10!

So I co-asked, and decided to follow the dev's suggestion to add my own function.  So I modified the mobileServices.Web-1.2.8.js directly, to get wns toast registration to work. The js file is shared here:https://onedrive.live.com/prev?cid=4c9ccfe08b0ea8f6&id=4C9CCFE08B0EA8F6%2147340&v=TextFileEditor .

There are few tricks to get cordova app build and work for windows 10!  
1. It can not be Any CPU!
2. You need to customize your own appxmanifest files in res/native/windows directory, by copying and modifying the corresponding files from the bld directory.
3. You've to build release version in order for the registration process to get the correct App information, so that the registration process can be successful.

Feel free to ask me if you need some help. 

Good luck!

Saturday, October 24, 2015

Change Visual Studio Cordova CLI from 4.3.0 to 5.3.3

I finally decided to change my VS2015's cordova project CLI from  4.3.0 to 5.3.3, so that I can try to play with windows 10.0 build.  But I didn't expect that Cordova CLI changed so much from 4 to 5, that I met a few issues and have to spend hours to solve them.

1. I've to install Android SDK's google repository in order to get it to build
2. I've to add a build.json as specified in http://stackoverflow.com/questions/31791215/visual-studio-2015-cordova-not-signing-apk, so that the release build can be signed.

Also, I've to switch the expired push plugin to phonegap-plugin-push, which I've to change code...

And the funny things about win10 build, the debug build doesn't carry out the push notification.  Only release build can successfully register with azure mobile service!