0

I've just installed the Xtify Cordova plugin for android. After following the implementation guide, I am having trouble registering a new user. It is stuck on an "inProgress" error.

Here is the deviceready event function:

var onDeviceReady=function()
{    
    // Xtify stuff
    // Start Xtify
    window.plugins.XtifySDK.start(notificationCallBack,
        function (error)
        {
            console.log("Error occurred while starting Xtify SDK.");
        });

    // get the xid
    window.plugins.XtifySDK.getXid(function(xid)
        {
            console.log('XID is: ' + xid );
        },
        function(error)
        {
        console.log("Error: " + error);
        });

    // test for registration success
    window.plugins.XtifySDK.isRegistered(function()
        {
            console.log("device is registered");
        },
        function (errorId)
        {
            if (errorId == "inProgress")
            {
                console.log("Registration in progress.");
            }
            else
            {
                console.log("Error: " + errorId);
            }
        });
};  

The error returned is only ever "inProgress". Additionally, I tried to put a timeout of 1, 2, and 5 seconds on the isRegistered() function to no avail. Attempting to get the xid before it is properly registered logs the following: "Error: The XID is not available until the device is registered". One last thing. I did trace the error back as far as I could, which was into Xtify itself. Everything seemed to be kosher with the plugin.

Anyone have an idea as to where I erred? I double and triple checked the implementation guide, but somewhere in those instructions must be the problem. Thanks in advance!

Bob

Bob
  • 31
  • 2
  • Hi, what Cordova version are you using? Did you try to get the sample app running in the sdk zip with your push credentials? Thank you. – Michael Bordash Aug 23 '12 at 02:30
  • Using Cordova 1.8.0. I just ran the sample app and got two different outcomes. In the emulator, it returned inProgress, as before. When I run it on my phone, though, I get an "invalid sender" error. I did verify that my google project id was correct. – Bob Aug 23 '12 at 14:23
  • A few thoughts I had: I want to be sure I have the correct appkey in the project.properties file. I believe it should be the key I find by going into my Xtify Appkey Manager and using the one labeled Application Key. Additionally, the only place I should be linking the app or Xtify to the Google api is with the aforementioned project.properties file. – Bob Aug 23 '12 at 16:53
  • @Bob - Are you still having trouble getting it working, or did you figure it out? I am trying to get it to work with Cordova 2.0. I have modified the plugin files to remove deprecated functions, but am considering downgrading to 1.8 just to try and get this working. I am getting the same problem with it sitting on the "inProgress" message, and stopping there. The app works fine, but it's not getting registered with Xtify. Just curious if you got it working, and if so, what did you do? – davesters81 Aug 31 '12 at 17:58

1 Answers1

2

Bob, I think your javascript section didn't include all of the required functions for Xtify to complete registration. After re-building your sample app, I was able to register and receive pushes to your app.

Michael Bordash
  • 1,072
  • 1
  • 10
  • 20
  • I am having the same problem as Bob. However, I modified the plugin JS and java file to work with the Cordova 2.0 changes, but I am getting the same "inProgress" message, and nothing is happening after that. I quadruple checked my keys, and everything else looks good. Are there any plans to update the Xtify Cordova plugin to work in 2.0? I run it through debugger, and it is getting to the Xtify.start call in the registerSDK function of the plugin, and the property values are being pulled in correctly. – davesters81 Aug 31 '12 at 18:07
  • Hi, yes we do have plans for PhoneGap Cordova 2.x. However, we've noticed that they've broken some core functionality that affects passing data to the webview. Xtify is not recommending upgrading to 2.x until PhoneGap have addressed the issues we've reported. Stick with 1.7, 1.8 or 1.9. – Michael Bordash Sep 06 '12 at 17:11