Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 140 forks source link

"Application not found" code - 210 error #64

Closed fenzik closed 9 years ago

fenzik commented 9 years ago

We are developing an android app using Phonegap and using Pushwoosh extension for push messages. We followed instructions based on this link to configure the extension - http://goo.gl/SPGWDJ

Now we are getting "Application not found" code - 210 error on executing the android app We provide google_project_number and pw_application_code correctly. Referred all the open and closed issues for the same kind issues. Please advice to resolve it.

Phonegap version - 3.6.3-0.22.1 (Mac) Our application_code - F6220-3CC33

Thanks in advance.

shaders commented 9 years ago

Can you paste console logs from the device? Server would not reply 210 error for no reason.

fenzik commented 9 years ago

unnamed

Attached the snapshot of the error. Kindly let me know if you need more information.

Thanks

shaders commented 9 years ago

Could you paste logs from the console / ddms?

fenzik commented 9 years ago

Please email me when you find the log.

Best regards, Fenzik On Dec 16, 2014 11:28 AM, "shaders" notifications@github.com wrote:

Could you paste logs from the console / ddms?

— Reply to this email directly or view it on GitHub https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin/issues/64#issuecomment-67116126 .

shaders commented 9 years ago

No logs attached.

fenzik commented 9 years ago

Sorry I forgot to attach the log file in my previous not. You can see the log here http://tny.cz/71024d10

shaders commented 9 years ago

Unfortunately logs does not contain the request body.

  1. What do you have in "onDeviceReady" function call?
  2. Do you have "PW_APPID" meta in AndroidManifest.xml?
fenzik commented 9 years ago
  1. What do you have in "onDeviceReady" function call? onDeviceReady function is given below
onDeviceReady: function() {

        app.receivedEvent('deviceready');

        ons.setDefaultDeviceBackButtonListener(function() {
            if (navigator.notification.confirm("Are you sure to close the app?",
                function(index) {
                    if (index == 1) { // OK button
                        // clear local storage before logout
                        window.localStorage.clear("currentuser");
                        navigator.app.exitApp(); // Close the app
                    }
                }
            ));
        });

        // Open any external link with InAppBrowser Plugin
        $(document).on('click', 'a[href^=http], a[href^=https]', function(e){

            e.preventDefault();
            var $this = $(this);
            var target = $this.data('inAppBrowser') || '_blank';

            window.open($this.attr('href'), target);

        });

        // Initialize Push Notifications
        // Uncomment the following initialization when you have made the appropriate configuration for iOS - http://goo.gl/YKQL8k and for Android - http://goo.gl/SPGWDJ
        app.initPushwoosh();

    }
  1. Do you have "PW_APPID" meta in AndroidManifest.xml? No, there is nothing related to PW_APPID in AndroidManifest.xml file

We are using Sensation Hybrid app ( http://codecanyon.net/item/sensation-phonegapcordova-full-hybrid-app/8004904 ). We followed a document to configure the pushwoosh plugin (http://goo.gl/SPGWDJ). They have separate pushwoosh js file. There we update the google_project_number and pw_application_code (pushwoosh application code)

shaders commented 9 years ago

What is the code of this function: app.initPushwoosh();

fenzik commented 9 years ago

The code for app.initPushwoosh()

// Register device for Push Notifications
    initPushwoosh: function() {
        var pushNotification = window.plugins.pushNotification;

                if(device.platform == "Android") {
                        registerPushwooshAndroid();
                }
        if (device.platform == "iPhone" || device.platform == "iOS") {
            registerPushwooshIOS();
        }
    }

You can see the pushwoosh-android.js file for reference http://pastebin.com/uankCH5j

shaders commented 9 years ago

Thank you, one more question - what version of the Pushwoosh plugin do you use?

fenzik commented 9 years ago

We are using 3.0 (https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git)

shaders commented 9 years ago

Could you please update to the 3.4.2 (if using PGB) or 3.4.5 (if using CLI)

fenzik commented 9 years ago

Updated plugin to 3.4.5 Still we are getting error. Attached log file. Please check in http://pastebin.com/kShaXU3r

shaders commented 9 years ago

Do you have link to the apk I could try on the device?

fenzik commented 9 years ago

Shared link of Mobile app for pushwoosh testing - https://www.dropbox.com/s/8cq4krp8g7169b1/SmackTest.apk?dl=0

shaders commented 9 years ago

Hi,

The file you posted is not APK file and is not valid.

java.util.zip.ZipException: error in opening zip file

smackbravo commented 9 years ago

Hi, On behalf of fenzik, Shared a link to download the .apk file of our extension - https://www.dropbox.com/s/xjmuygwm0u460el/SmackTest-Updated.apk?dl=0. Tested the link on mobile

—  Thanks, Rajkumar Mohan

On 29 December 2014 at 11:05:58 am, shaders (notifications@github.com) wrote:

Hi,

The file you posted is not APK file and is not valid.

java.util.zip.ZipException: error in opening zip file

— Reply to this email directly or view it on GitHub.

shaders commented 9 years ago

In your index.html file you include pushwoosh-android.js, then include pushwoosh-ios.js.

    <script type="text/javascript" src="js/pushwoosh-android.js"></script>
    <script type="text/javascript" src="js/pushwoosh-ios.js"></script>

In pushwoosh-android.js you define:

    // PushWoosh Application Code
    var pw_application_code = "VALID_PUSHWOOSH_APP_CODE";

However in pushwoosh-ios.js you override this with:

    // PushWoosh Application Code
    var pw_application_code = "XXXXX-XXXXX";

That's why you receive application not found error, because pw_application_code variable is now XXXXX-XXXXX!

smackbravo commented 9 years ago

Hi, It works now !!!  Thanks for your help

--  Thanks, Rajkumar

On 29 December 2014 at 3:09:57 pm, shaders (notifications@github.com) wrote:

In your index.html file you include pushwoosh-android.js, then include pushwoosh-ios.js.

<script type="text/javascript" src="js/pushwoosh-android.js"></script>
<script type="text/javascript" src="js/pushwoosh-ios.js"></script>

In pushwoosh-android.js you define:

// PushWoosh Application Code
var pw_application_code = "VALID_PUSHWOOSH_APP_CODE";

However in pushwoosh-ios.js you override this with:

// PushWoosh Application Code
var pw_application_code = "XXXXX-XXXXX";

That's why you receive application not found error, because pw_application_code variable is now XXXXX-XXXXX!

— Reply to this email directly or view it on GitHub.

fenzik commented 9 years ago

@shaders We should have verified it. Thanks for you time.