I am unable to add user for push notification in my android app

+1 vote

I am unable to add user for push notification in my android app:

Below is the snippet of code that was provided in tutorial for Android pus notification

 

                                                                !!!!----code---!!!

String Api_key = "40d69f76415ab92de0a85d9eb5fbd667eb79bd9b7d1b37fc8af56fc2352f002d";
String Secret_key =  "4a990f005383bad9550d1fec202ccde93e6db1257d9cdf5dd1186a55bd3a6a0a";
 
 
@Override
public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
       ((TextView) findViewById(R.id.page_header)).setText("Main Activty");
       App42API.initialize(this,Api_key,Secret_key);
       App42API.setLoggedInUser("hitesh.vinod.jain111@accenture.com") ;
       Util.registerWithApp42("starry-app-723");
       
}
 
                                              !!!-- code ends here --- !!!
 
Where m i going wrong please help...
Was asked to pass on the 4 parameters, API key, Secretkey, LggedInAsUser and Goog project Id
closed with the note: Problem resolved
asked Oct 6, 2014 in App42 Cloud API-BaaS by Hitesh Jain (16 points)
closed Oct 27, 2014 by sushil
Hey, Logs are not pretty much clear, will you please debug your code to trace where it's going wrong. Hope you have modified AndroidManifest.xml file as mentioned in ReadME file.
Or you can share your sample project to trace it out.

Thanks
Vishnu
ok , got it working .. .the PUSH messages are coming now on my device ...

my next problem is , when i click open the message, the app crashes ...

what do i do if i just want to start the app up when the message is clicked ?
Hey , have you changes the name of Activity in AndroidManifest.xml file.
If you are using App42GCMService.java file of our sample project, you need to make a change here with your own Activity.
 <service android:name="com.example.app42sample.App42GCMService" >
            <meta-data android:name="onMessageOpen" android:value="com.example.app42sample.MessageActivity" />
        </service>
Awesome ! Works fine now !

I just set it to com.example.app42sample.MainActivity and my app starts up :)

Thank ...

btw , whats the sound and badge option for ? can i send any sound and badge on Android ?
Hey, In Android you can customize your Notification in the same way you want, and also set the custom sound , badges count.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...