1. Download our Official Android App: Forums for Android!

Apps GCM with online server testing

Discussion in 'Android Development' started by HeavensSentSword, Feb 22, 2016.

  1. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    93
    Posts:
    134
    Joined:
    Jan 19, 2016

    Jan 19, 2016
    134
    36
    93
    Male
    i am working at trying to get a simple GCM push notification to my test app.
    i am basically using the Googles tutorial and got the whole app set up except for the
    sendRegistrationToServer(String token) method yet. I just don't know what to put in this me. I found this tutorial but I dont understand the sendRegistarionToServer method implementation.
    http://inducesmile.com/android/andr...-gcm-php-mysql-and-okhttp-square-open-source/
    I set up my project just like the one in this tutorial which pretty much followed the Google one but implemented the sendRegistarionToServer mehtod.

    I want to use this online test server
    http://www.androidbegin.com/tutorial/gcm.html

    Thank you for any help with this.
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    Did you register for a GCM API key and SenderID?
     
    HeavensSentSword likes this.
  3. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    93
    Posts:
    134
    Joined:
    Jan 19, 2016

    Jan 19, 2016
    134
    36
    93
    Male
    Yes I have both and the config file in the app as well.
    Do I not have to use the sendReg method to get a DeviceID for the phone?
    Should I instead of using the config google-service file just hard code the values into the app?
     
  4. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    93
    Posts:
    134
    Joined:
    Jan 19, 2016

    Jan 19, 2016
    134
    36
    93
    Male
    Ok it just started to work............
    I don't know why I haven't made any changes to the code.
    I think it may have been a setting with the emulator that I was using. I just deleted that one which was a Nexus 5 and made a new one and it started to work. Alls well that ends well!
     
  5. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    Wow self-fixing code. Can I have some of that? :)
     
    HeavensSentSword likes this.
  6. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    93
    Posts:
    134
    Joined:
    Jan 19, 2016

    Jan 19, 2016
    134
    36
    93
    Male
    I really hate when that happens because there is no real fix. So I am hesitant using the code in a bigger project. More testing!
     
  7. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    You can never do enough testing
     
    HeavensSentSword likes this.

Share This Page

Loading...