1. Are you ready for the Galaxy S20? Here is everything we know so far!

GCM with online server testing

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

  1. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter

    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.
     


  2. Deleted User

    Deleted User Guest

    Did you register for a GCM API key and SenderID?
     
    HeavensSentSword likes this.
  3. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter

    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

    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. Deleted User

    Deleted User Guest

    Wow self-fixing code. Can I have some of that? :)
     
    HeavensSentSword likes this.
  6. HeavensSentSword

    HeavensSentSword Well-Known Member
    Thread Starter

    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. Deleted User

    Deleted User Guest

    You can never do enough testing
     
    HeavensSentSword likes this.
Loading...

Share This Page

Loading...