0
StackMobAndroid.init(this.getApplicationContext(), StackMob.OAuthVersion.One, 0, API_KEY, API_SECRET);

API_KEY is stackmob's public key(?) API_SECRET ? the api_key which is obtained from GCM will be configured in stackmob's push module.

Daniele Armanasco
  • 7,289
  • 9
  • 43
  • 55

1 Answers1

0

Api Sercret and API Key means After installing from Stackmob website for your android applications they will be providing the API key and APISECRET Key to access the account for push notifications.

Did you ever visited Stackmob site ? or registered the account ?

You need to sign up here https://dashboard.stackmob.com/signup

itsrajesh4uguys
  • 4,610
  • 3
  • 20
  • 31
  • I had visited, infact I found that API_KEY is public key and API_SECRET is private key. Thank you. – user2361328 May 08 '13 at 09:46
  • Now I am getting the below error while sending a push message, please help me in this. 05-08 15:11:33.070: I/StackMob(32106): Response StatusCode: 204 05-08 15:11:33.070: I/StackMob(32106): Response Headers: {Content-Type=application/json;charset=utf-8, Connection=Keep-Alive, Content-Length=0} 05-08 15:11:33.070: I/StackMob(32106): Response: 05-08 15:11:35.148: W/MessageQueue(32106): Handler{4058d1e0} sending message to a Handler on a dead thread 05-08 15:11:35.148: W/MessageQueue(32106): java.lang.RuntimeException: Handler{4058d1e0} sending message to a Handler on a dead thread – user2361328 May 08 '13 at 09:51
  • Yeah, I am trying to run the push notifications demo. Hope I am in the last step. When I send the push message it's sent successfully but the above said warnings are coming and not getting any notification to my device. – user2361328 May 08 '13 at 10:27
  • i mean https://github.com/stackmob/stackmob-android-examples these samples.. the error says your thread is not in alive.. – itsrajesh4uguys May 08 '13 at 10:40
  • Able to solve the above error by placing the below code in the calling method. Handler h = new Handler(Looper.getMainLooper()); h.post(new Runnable() { public void run() { Toast.makeText(ctx, "message",Toast.LENGTH_LONG).show(); } }); – user2361328 May 09 '13 at 09:38