Git Product home page Git Product logo

azure-mobile-services-cordova's Introduction

Apache Cordova plugin for Azure Mobile Services

DEPRECATED - Azure Mobile Services has been superseded by Azure App Service Mobile Apps and is scheduled for removal from Azure. We recommend using Azure Mobile Apps for all new mobile backend deployments. Read this announcement to learn more about the pending deprecation of this service.

Learn about migrating your site to Azure App Service.

Get started with Azure Mobile Apps, see the Azure Mobile Apps documentation center.

The Cordova plugin for connecting to Azure Mobile Apps resides in the azure-mobile-apps-cordova-client repository.

Getting Started

With Microsoft Azure Mobile Services you can add a scalable backend to your connected client applications in minutes.

To learn more, visit our Developer Center.

If you are new to Mobile Services, you can get started by following our tutorials for connecting your Mobile Services cloud backend to Cordova apps,

Sample usage

The following code creates a new client object to access the todolist mobile service and create a new proxy object for the TodoItem table.

var mobileService = new WindowsAzure.MobileServiceClient(
        "https://todolist.azure-mobile.net",
        "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    );

var todoTable = mobileService.getTable('TodoItem');

Need Help?

Be sure to check out the Mobile Services Developer Forum if you are having trouble. The Mobile Services product team actively monitors the forum and will be more than happy to assist you.

Contribute Code or Provide Feedback

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

If you encounter any bugs with the library please file an issue in the Issues section of the project.

Learn More

Microsoft Azure Mobile Services Developer Center

azure-mobile-services-cordova's People

Contributors

dhei avatar phvannor avatar shrishrirang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-mobile-services-cordova's Issues

How do you register for specific push notification tags?

I'm successfully using the latest v2.0.40106.0-beta of the mobile services client to register for broadcast push notifications for gcm, apns & wns. However, I have not been able to figure out how to use the push register API for specific push notification tags.

The MobileServices.Web.js source code has a cryptic reference about supplying the tags in a template, but I haven't been able to find an example of such a template. Can someone please point me to a reference on how to register for specific push notification tags? Thanks

  /// <param name="templates" type="string">
    /// An object containing template definitions. Template objects should contain body, headers and tags properties.
    /// </param>

Dependencies on inAppBrowser

I update phonegap version 3.70 to cli-5.2.0 but I can't build in androip app
I use this plugin for push notificiton service.

It display eror message follow below,
Error - Some official plugins have to be updated if using PhoneGap >= 4.0.0. Please upgrade the version of any plugins that may include the following file: InAppBrowser.java

Installing "org.apache.cordova.statusbar" at "0.1.4" for android
Installing "com.phonegap.plugins.facebookconnect" at "0.9.0" for android
Installing "com.adobe.plugins.GAPlugin" at "2.4.0" for android
Installing "org.apache.cordova.inappbrowser" at "0.5.2" for android
Installing "com.microsoft.azure-mobile-services" at "1.2.8" for android
Notice: org.apache.cordova.inappbrowser has been automatically converted to cordova-plugin-inappbrowser and fetched from npm. This is due to our old plugins registry shutting down.
cordova-plugin-inappbrowser" will not install due to "/project/cordova/plugins/org.apache.cordova.inappbrowser" being installed.
Dependent plugin "org.apache.cordova.inappbrowser" already installed on android.

Installing "com.phonegap.plugins.PushPlugin" at "2.5.0" for android
Installing "ptdev.makingwaves2.estimotes" at "1.0.1" for android
Installing "org.apache.cordova.vibration" at "0.3.13" for android
Installing "org.apache.cordova.dialogs" at "0.3.0" for android
Installing "org.apache.cordova.camera" at "0.3.6" for android
Installing "org.apache.cordova.network-information" at "0.2.15" for android
Installing "org.apache.cordova.geolocation" at "0.3.12" for android
Installing "org.apache.cordova.device" at "0.3.0" for android
Fetching plugin "cordova-plugin-whitelist" via npm
Installing "cordova-plugin-whitelist" at "1.2.2" for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Fetching plugin "cordova-plugin-inappbrowser" via npm
cordova-plugin-inappbrowser" will not install due to "/project/cordova/plugins/org.apache.cordova.inappbrowser" being installed.
Plugin "org.apache.cordova.inappbrowser" already installed on android.

Windows Phone 8 Deploy error

When I deploy to windows phone 8.1 with the plugin, I get a CS4014 error. It's says "Consider applying the 'await' operator to the result of the call."

Unable to find API reference

Hi there

Please indicate in the readme or somewhere else in this repo, where to find the API reference?

Thanks!

Puth notification without login

I need to register my push notifications in a cordova app without a login with a service. Is this possible?

Obs1: My implementation is like explained here: https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-cordova-get-started-push/

Obs2: I'm using cordova-plugin-ms-azure-mobile-apps 2.0.0-beta4

Obs3: I receive a error when I try remove the login: "Failed to load resource: the server responded with a status of 405 (Method Not Allowed)"

Obs4: I don't want use login because it is out of scope.

Thank's.

logging out does not clear session/cookies in inappbrowser

Using client.login() after logging out makes the login go through again without user interactions (new credentials). This could be solved with adding the clearcache=yes or the clearsessioncache=yes into the window.open() options argument.

e.g.
var loginWindow = window.open(startPage, "_blank", "location=no,clearcache=yes")

Unable to login using google authentication

I just started using this plugin. I was able to login using google authentication on chrome browser in my desktop. But, When I install in device and try to login using using google authentication I am getting below.
Here is my code. I installed below plugins

 <plugin name="cordova-plugin-whitelist" version="1.2.1" />
  <plugin name="com.microsoft.azure-mobile-services" version="1.2.9" />
  <plugin name="cordova-plugin-inappbrowser" version="1.3.0" />
  <plugin name="cordova-plugin-device" version="1.1.1" />
  mobileService = new WindowsAzure.MobileServiceClient(
              "https://test.azure-mobile.net/",
              "XXXXXXXXXXXXXXXXXXXXXX"
          );
            mobileService.login('google').then(function (result) {
                console.log('success - result',result);              

            }, function (error) {
                console.log(error);
            });`

screenshot_2016-03-18-20-16-32 1

logout doesn't completly logs out

I'm having the scenario that I want to authenticate users using microsoft or google accounts.
Everything works pretty well and as soon as I'm logout I cannot access the authorized controllers anymore (as expected).

But as soon as I'm calling login again the login is performed automatically (it’s not required to enter the user credentials again). This is fine and convenient as long as I want to login the same user again. But in my application I want to change the user; which is not possible at the moment since the previous user is just automatically logged in so the new user never has the chance to login.
From a security point of view this is even worse because this means that not authenticated users can just use the old login of the previous user to access the other users data (even when the user previously successfully logged out).

So the flow must be:

  1. client.login(...
  2. // User does authenticated actions
  3. client.logout();
    // A new user is required this time!!! Which is not possible since the login happens automatically!
  4. client.login(...

This question was also already asked in Stackoverflow by a different user:
http://stackoverflow.com/questions/32928370/how-do-you-completely-log-out-of-azure-with-google-provider

How to clear cache data

Once user authenticated if he is not authorized then I should restrict him to proceed further. I am able to restrict him for further proceeding. but when I try to login as different user, Outh window has previous credentials and it is trying to log in as previous user. I need to delete oauth cache in phonegap application. any idea?

Can't register template

Hi, I am trying to implement Azure Push Notifications on my Ionic project. I am already accessing a table and the INSERT method is working well, I can access and write on my Azure database.

The problem is when I try to register to get Push notifications, I have a registration ID from gcm and my template, but when I call:

    mobileClient.push.gcm.registerTemplate()

It says Cannot read property gcm of undefined, so my mobileClient instance doesn't have the push method, has something changed?
Because I used that same method on a previous Cordova app and it was working well.

Here is the full code for my Push Notifications registration:

    var MOBILE_SERVICE_URL = 'https://XXXX.azure-mobile.net/';
    var MOBILE_SERVICE_APP_KEY = 'XXXXXXXXXXXXXXXXXXX';
    var mobileClient = new WindowsAzure.MobileServiceClient(MOBILE_SERVICE_URL, MOBILE_SERVICE_APP_KEY); 

//Cordova Push Plugin
          var push = PushNotification.init({
              "android": {
                  "senderID": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
              },
              "ios": {"alert": "true", "badge": "true", "sound": "true"}, 
              "windows": {} 
          });

          push.on('registration', function(data) {
              console.log("registration event");
              console.log(JSON.stringify(data));
              console.log($.connection.hub.id);
              var template = "{\"data\":{\"message\":\"$(message)\",\"touserid\":\"$(touserid)\",\"userid\":\"$(userid)\",\"username\":\"$(username)\",\"device\":\"$(device)\"}}"; 
//Registering template with registration id
              mobileClient.push.gcm.registerTemplate(e.regid, "myTemplateBBAndroid", template, [$.connection.hub.id]).done(function () {
              console.log("Registered with hub!");
              }); 
          });

Tags for Android push notifications is not working.

After tracing the source code of azure mobile service plugin, I found that
gcm.prototype.registerTemplate = function (deviceId, name, bodyTemplate, tags)
is missing the "expiryTemplate" parameter. Changing it to
gcm.prototype.registerTemplate = function (deviceId, name, bodyTemplate, expiryTemplate, tags)
fix the problem.

Bug in plugin

Hi,

I am using the plugin to provision Android devices on azure. A trace on the request sent from the device into Azure shows the following trace:

success handler called index.html:140
Android registered!!!! index.html:126
Called onNotificationGCM! index.html:59
gcm id APA91bFLsh_iVWnl0s...O35fTI1Xx8AyaOOhVKM--Ou78PPla2heJf5iGe9rwvO1x8b4w7XgmHQ-xZwFq34Log index.html:63
Failed to load resource: net::ERR_CACHE_MISS https://hipernation.azure-mobile.net/push/registrations?platform=apns&devic…iGe9rgQtzHaKT98i-JGGag9QLVGKqBSk...g
Uncaught Error: Unexpected connection failure. MobileServices.Web.min.js:8
mobileClient.push.gcm.registerTemplate(e.regid, "myTemplate", template,null).done(function () {

As you see the registration is being sent as an APNS request: (line -3: registrations?platform=apns)
It should be sent as a GCM instead.

Please have a look

Thanks
Patrick Gharios

Error 404 on update

Can't update from Visual Studio to the last version of the plugin. The output message :

CordovaError: Failed to fetch plugin com.microsoft.azure-mobile-services via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com.microsoft.azure-mobile-services
at C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:146:33
at _rejected (C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:797:24)
at C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:823:30
at Promise.when (C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1035:31)
at Promise.promise.promiseDispatch (C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:741:41)
at C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
at flush (C:\Users\jredondo\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:355:11)
Lis.

Register Notification Hub for Windows Notification Service

In my Cordova APP, I cannot use this plugin to register notification hub for Windows Notification Service, but it's ok for Android GCM & iOS APNS. Does this plugin support push notifications for Cordova app on Windows 8.1 using WNS?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.