Android Push Registration Issue, No error

5 posts, 0 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Aug 2015

    Posted 28 Aug 2015 Link to this post

    I have set up a app, very basic as i have had issues learning the platform, and i have iOS sorted, which can receive push notifications, it registers, and i can see it in the backend list of devices.  But...

    When it comes to Android, it fails right at the start, and it looks like a problem with where it registers, but the error i cannot completely see.  But this is the error message:

    01.device is ready app.js:4
    02.a
    03.additionalInformation: "<!DOCTYPE html>↵<!--[if IE 7]><html lang="en" class="ie7"><![endif]-->↵<!--[if gt IE 7]><!-- <html><!--<![endif]-->↵<head>↵    <meta charset="utf-8">↵  <title>BT HUB Welcome</title>↵    <meta name="Keywords" content="BT Hub" />↵<meta name="Description" content="BT Hub" />↵<link href="oie/assets/css/core.css" media="all" type="text/css" rel="stylesheet" />↵<meta id="viewport" name="viewport" content="initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />↵<style type="text/css">↵    .breadcrumbs { display: none; }↵</style>↵</head>↵<body class="mobile-template">↵    <div id="page">  ↵      <div id="dynamic-content-wrapper">↵         <div id="header">↵              <div class="logo">↵                 <img title="Go to BT.com" alt="BT" src="oie/assets/images/logo.gif">↵               </div>↵         </div>↵         <div id="content" class="clearfix">↵                <div class="modules main-content">↵                 <ol class="breadcrumbs clearfix twoSteps step0of2">↵                        <li><span>1</span> <span class="text">Choose if you want <br>parental controls</span></li>↵                        <li class="last"><span>2</span> <span class="text">Log in to <br>set up your extras</span></li>↵                    </ol>↵                   <div class="whiteLink">↵                        <script type="text/javascript">↵                            document.write('<a id="launchMac" onClick="disableWG();"></a>');↵                       </script>↵                      <noscript>↵                         <form action="oie.cgi" method="get">↵                               <input id="EI" name="EI" type="hidden" value="1">↵                              <input id="no" name="no" class="whiteLinkButton" type="submit" value="">↵                           </form>                     ↵                       </noscript> ↵                   </div>↵                 <h2>Welcome to BT</h2>↵                 <p>You are now successfully connected to your BT Home Hub.</p>↵                 <p class="marginBottom15">We're going to guide you through a few simple steps to finish getting you set up and online.</p>↵             </div>↵         </div>↵     </div>↵     <div id="fixed-content">↵           <div class="navigation">↵               <ul class="clearfix">↵                  <li>↵                       <a href="mobile-step1.html" class="button blueButton step0button">Get started</a>↵                  </li>↵              </ul>↵          </div>↵         <a href="http://www.bt.com" class="admin-link">Admin</a>↵       </div>↵    </div><!-- END #page -->↵    <div id="loading-container"><img src="oie/assets/images/loading.gif" /></div>↵    <script src="oie/assets/js/main.js" type="text/javascript"></script>↵</body>↵</html>↵"
    04.code: undefined
    05.errorType: 1
    06.message: undefined
    07.name: "EverliveError"
    08.stack: (...)
    09.get stack: function (){return c.stack}
    10.arguments: null
    11.caller: null
    12.length: 0
    13.name: ""
    14.prototype: Object
    15.__proto__: function Empty() {}
    16.<function scope>
    17.__proto__: Error

    I cannot seem to get any better message, so very hard where to look.  But it looks like my router is telling me it cannot reach the endpoint.  As i have in the past seen something when a webpage is not available ?

     

    Any ideas ?

     

    Thanks

     

    Andrew

  2. Andrew
    Andrew avatar
    4 posts
    Member since:
    Aug 2015

    Posted 28 Aug 2015 in reply to Andrew Link to this post

    To give some more info  I seem to get two requests, below.  But you can see one is redirected, and the other is okay.  but the last one comes back with my Router Home Page.   I get nothing back on the first ?

    Request URL:<br>http://api.everlive.com/v1/9AXkxpMhsOSoNnOi/Push/Devices/HardwareId/e877​**********4f7?_el=1440*****15855<br>Request Method: GET<br>Status Code: 302 Redirect

    And then after it comes this one:

    Request URL: http://192.168.1.254/mobile-step0.html?org_url=http://api.everlive.com%2fv1%2f9AXkxpMhsOSoNnOi%2fPush%2fDevices%2fHardwareId%2fe877**********4f7%3f%5fel%3d1440783215855<br>Request Method: GET<br>Status Code: 200 OK

  3. Andrew
    Andrew avatar
    4 posts
    Member since:
    Aug 2015

    Posted 28 Aug 2015 Link to this post

    This is the code i am using to register, i cannot edit, so sorry for the 3 posts

    01.document.addEventListener("deviceready", onDeviceReady, false);
    02. 
    03.function onDeviceReady() {
    04.    console.log("device is ready");
    05.    // Now safe to use device APIs
    06. 
    07.    var el = new Everlive('e**********5');
    08.    var pushSettings = {
    09.        iOS: {
    10.            badge: true,
    11.            sound: true,
    12.            alert: true,
    13.            clearBadge: true
    14.        },
    15.        android: {
    16.            projectNumber: '*22​*****975'
    17.        },
    18. 
    19.        notificationCallbackIOS: function (e) {
    20.            // logic for handling push in iOS
    21.        },
    22.        notificationCallbackAndroid: function (e) {
    23.            // logic for handling push in Android
    24.        }
    25.    };
    26. 
    27.    el.push.register(
    28.        pushSettings,
    29.        function successCallback(data) {
    30.            // This function will be called once the device is successfully registered
    31.            console.log(data);
    32.        },
    33.        function errorCallback(error) {
    34.            // This callback will be called any errors occurred during the device
    35.            // registration process
    36.            console.log(error);
    37.        }
    38.    );
    39.};

  4. Andrew
    Andrew avatar
    4 posts
    Member since:
    Aug 2015

    Posted 28 Aug 2015 Link to this post

    The Everlive API is different because I did not mean to post my live key. So I changed it but still I get the same response.  The old API, from the first two posts no longer exists.   As I said, this code works with iOS and it registers on Telerik Backend.

     

    Thanks again.

     

     

  5. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 02 Sep 2015 Link to this post

    Hi Andrew,

    I will update this post once the issue is resolved in your private support ticket so that the resolution is available to the public.

    Let me know if you have questions.

    Regards,
    Anton Dobrev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top