Android Tutorial Android push notification (GCM) framework and tutorial

Discussion in 'Tutorials & Examples' started by Erel, Jul 3, 2012.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Press on the start menu and then run cmd.exe.
     
  2. DonManfred

    DonManfred Expert Licensed User

    See here
     
  3. buras3

    buras3 Active Member Licensed User

    got it :)
     
    DonManfred likes this.
  4. Bel

    Bel Active Member Licensed User

    Hi
    I cannot use GCM in basic4android when i use Appcompact library in my project and when run it,get error app parsing
    When i remove below line code from manifest,dont problem
    AddManifestText(<permission android:name="$PACKAGE$.permission.C2D_MESSAGE" android:protectionLevel="signature" />)
    what's problem?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this and post the manifest editor code and the error message.
     
  6. Bel

    Bel Active Member Licensed User

    It solved.I change package name from upper case to lower case
     
  7. Bel

    Bel Active Member Licensed User

    I'm sorry friend i have a problem.
    I send push to device and it is success to send message
    But in device dont receive any message
    I receive message already but now cannot receive it
     
  8. DonManfred

    DonManfred Expert Licensed User

    I see.....

    [​IMG]

    Sorry, i don´t see anything but the info "You should create a new Thread for any new Question. You need to provide more info (upload example project which shows the problem)".
     
  9. Bel

    Bel Active Member Licensed User

    i dont have anything info about this problem because that is working and not exist any error
    only i could receive message in my device but now i cannot receive message (in other device,i can receive message)
     
  10. Bel

    Bel Active Member Licensed User

    Hi again
    I have a question
    I send push to 1000 device
    now result is failure:10 and success:990
    My device in failure list but after 1 hour,i receive push
     
  11. Alisson

    Alisson Active Member Licensed User

    I have the error:

    Code:
    C:\Users\modal\Downloads\Desktop>b4a_gcm.bat send gcm-02 "this is a test"

    C:\Users\modal\Downloads\Desktop>java -cp b4a_gcm.jar anywheresoftware.b4a.c2dm.
    C2DM send gcm-
    02 "this is a test"
    java.lang.RuntimeException: No 
    id found for name: gcm-02
            at anywheresoftware.b4a.c2dm.C2DM.getIdForName(C2DM.java:
    90)
            at anywheresoftware.b4a.c2dm.C2DM.sendMessageTo(C2DM.java:
    48)
            at anywheresoftware.b4a.c2dm.C2DM.main(C2DM.java:
    218)

    C:\Users\modal\Downloads\Desktop>b4a_gcm.bat send sam 
    "this is a test"

    C:\Users\modal\Downloads\Desktop>java -cp b4a_gcm.jar anywheresoftware.b4a.c2dm.
    C2DM send sam 
    "this is a test"
    java.lang.RuntimeException: java.io.IOException: 
    Server returned HTTP response c
    ode: 
    401 for URL: https://android.googleapis.com/gcm/send
            at anywheresoftware.b4a.c2dm.C2DM.sendMessageTo(C2DM.java:
    57)
            at anywheresoftware.b4a.c2dm.C2DM.main(C2DM.java:
    218)

    C:\Users\modal\Downloads\Desktop>b4a_gcm.bat send alisson 
    "this is a test"

    C:\Users\modal\Downloads\Desktop>java -cp b4a_gcm.jar anywheresoftware.b4a.c2dm.
    C2DM send alisson 
    "this is a test"
    java.lang.RuntimeException: java.io.IOException: 
    Server returned HTTP response c
    ode: 
    401 for URL: https://android.googleapis.com/gcm/send
            at anywheresoftware.b4a.c2dm.C2DM.sendMessageTo(C2DM.java:
    57)
            at anywheresoftware.b4a.c2dm.C2DM.main(C2DM.java:
    218)

    C:\Users\modal\Downloads\Desktop>b4a_gcm.bat send gcm-
    02 "this is a test"

    C:\Users\modal\Downloads\Desktop>java -cp b4a_gcm.jar anywheresoftware.b4a.c2dm.
    C2DM send gcm-
    02 "this is a test"
    java.lang.RuntimeException: No 
    id found for name: gcm-02
            at anywheresoftware.b4a.c2dm.C2DM.getIdForName(C2DM.java:
    90)
            at anywheresoftware.b4a.c2dm.C2DM.sendMessageTo(C2DM.java:
    48)
            at anywheresoftware.b4a.c2dm.C2DM.main(C2DM.java:
    218)
    My config txt:

    Code:
    board_url=http://b4aserver.basic4ppc.com/c2dm_board.php
    server_password=9034f3po4gj34
    api_key=AIzaSyDBnh_72u5mYw9lot1DiqiLWYbTZOOBatc
    My project is named gcm-02.

    When execute the app, show message: Registration completed successfully.
    In the editText write "alisson" and click "Register"

    I wait feedback!! :)
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    The parameter after send should be allison.

    However based on this error message the key is not configured properly. Make sure that the api_key in the configuration file is correct.
     
  13. tznikos

    tznikos Member Licensed User

    Hi when i send a request from command prompt return this

    Screenshot_7.png

    Thanks If anyone help me.
     
  14. Erel

    Erel Administrator Staff Member Licensed User

Loading...