Push C2DM notification Did not work - android

I followed the same steps that are mentioned in the "Android Cloud to Device Messaging (C2DM) - Tutorial", downloading the source code for the project and customizing it for my purpose (changing the package name and role e-mail sender).
Unfortunately I get an error message stating:
"Unable to start service Intent
{act=com.google.android.c2dm.intent.REGISTER ... }: not found" in logcat.
Knowing that I have added a Google account to the emulator which is different than the one I used when signing up on the service in the first place.
Can anyone provide help or direction in how can I get the registeration key correctly setup and solve this problem?

I think I figure the solution for my above question which is, you have to create new AVD using android AVD manager that its target Google APIs either level 8 or 15 or whatever, not using android API.
and also you have to have google account that added to your emulator which is the role e-mail that you used in development process of your application.
I hope that solve all problems faced other developers regarding this issue.

Related

Firebase message failed

I have a xamarin android app and I want to add notifications. I followed the instructions from this link:
https://developer.xamarin.com/guides/android/application_fundamentals/notifications/remote-notifications-with-fcm/
Everything worked great until I got to the Implement Client App Code section. At first, when I clicked the button to get the InstanceId token, I didn't get anything. So I added the bit of code that shows the google_app_id. Mine does not match the mobilesdk_app_id value in the json file. But then I did get an InstanceId in the output. I used that id in the firebase console and the message fails, "Unregistered registration token". I followed the directions exactly, twice. And searched for the error but did not find any answers. I guess my token is wrong? How do I fix that?
I just went through the same tutorial and received the same error in the firebase console. My problem turned out to be my android emulator configuration.
In the Android Virtual Device Manager I had to set my device's Target to Google APIs
I also had to install Google Play services from the Android SDK Manager
Lastly, I uninstalled my app on the emulator and reinstalled it to refresh the token.
After these steps i was able to send push notifications from the firebase console.
This video helped me out.

Google+ Sign In on Android 'Internal Error occurred'

I've spent hours trying to get Google+ sign in to work on my Android app. I've read through all ~20 posts on this topic on StackOverflow, but none of the solutions have solved my problem. This is what I've tried:
I've set the correct SHA1 key and package name (Google Play Maps works fine in my app) in the credentials section of the API console
I've turned on the Google+ API and setup the consent screen in the API console
am using the sample code from the SDK
read the documentation here and here
have turned on verbose logging for Google Play
but I keep getting "internal error occurred" messages, and the log says:
onConnectionFailed: ConnectionResult.getErrorCode() = 4
which indicates "SIGN_IN_REQUIRED", but no dialog to sign in or select an account shows up on my device (Nexus 4, running Android 4.4.2).
Can anyone help?
Let me tel you something that happens quite often. When you copy the SHA1 and the app package name in the required fields of the create client id form from the dev console, be dead sure that you didn't copy a space too in one of that fields. This is what happened to me. I've spent several hours on searching the web up and down for info about the ConnectionResult.getErrorCode() = 4 but was in vain. Than I've thought that it would be worth creating a new client ID from scratch and than I noticed that I was copying a space after the app package name.
Also you'll need to create a new client ID if you rethink and change the app package.
Maybe you're problem is solved but I hope this answer will help others that wonder here.

Dependencies for GCM Push Notification

I have been working on GCM Push Notification for my upcoming project and I have been facing several confusion regarding its implementations. I have followed the following links:
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
http://developer.android.com/google/gcm/client.html
The implementation that I ended up with works quite fine with the emulator(not on all of them). Here is a link to my registration implementation.
It works fine with an emulator running on platform 4.2.2
It isn't working with an emulator running on platform 2.3.3
My experiences so far tells me that, on the client side, the following things must be ensured to enable GCM properly:
Google Play Services installed
The device synced with a Google account.
Am I right?
So I have the following questions to ask:
What are the client side dependencies that I should be worried about while implementing GCM? What should I check in my code?
When I uncomment the lines from 110 to 114 in the above code to check play services, I receive the following error log http://pastebin.com/C2BJkiyt . But it still allows me to register. What's wrong?
When I run the working code(working on emulator) on a real device having Android 2.3.6, it doesn't work. It also doesn't work on a device having ICS.
Thanks for the time.
You are registering to GCM with the deprecated library method GCMRegistrar.register. This can still work, but it requires on pre-4.0.4 Android devices with a logged-in Google account.
Google encourage you to stop using the deprecated library, and instead use the register method of GoogleCloudMessaging class, which doesn't require a Google account even in older Android versions. See their GCM Demo for an example.
The code that checks for play services is only relevant if you switch to the new registration method.
As for why the deprecated registration method doesn't work for you on some devices, you'll have to include the logcat to get help with that.

Google Play Services and "There is no linked app associated with this client ID"

I'm trying to implement Google Play Services following Google's documentation and I'm seeing the following when I try to connect my GameClient:
E/Volley: [4953] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/me
E/Volley: [4953] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/me
E/SignInIntentService: There is no linked app associated with this client ID.
I've checked that the SHA1 fingerprint of the certificate signing the APK, the SHA1 of the debug certificate, and the SHA1 given to the Google API do match up and they do. I've checked that the app id is declared in the manifest in the application item (I've taken in my case the 13 digit numerical id, not one that also includes a package). I've also checked that the test accounts I'm using are each listed in the Developer Console and they are; they're each #gmail.com too, and they include my developer address. They've each activated Google Plus.
I've tried this from an API 16 S3 device and an API 17 Google API simulator. The app's package name is correctly declared in the manifest, on the developer console and matches the API package name. The app is listed as a client of the game service, and is shown as 'ready for testing'.
In short I'm struggling to see what my mistake can be and what I've missed. I think I have everything from Google's troubleshooting addressed too. I've looked at the main questions here on StackOverflow, and they're covered. Whatever it is I'm missing is probably staring me full in the face. What can I be missing?
I got stuck on this problem for a long time until I realised that I had two strings in my app called "app_id". One from the Facebook SDK and one from Google. I renamed the Google app_id (and changed the corresponding manifest reference) and all was well.
It is POSSIBLE that you have a similar problem. If you can't see the error then I would try to write out the app_id to syslog to confirm that this is not the cause of the problem.
Incidentally, all my Google app_id s (client ids) are 12 bytes not 13, so perhaps you should start by checking that.
Good Luck !
Even after redoing everything, everything, I still encountered the same problem. However, I subsequently encountered a "This package is already in use" error message on Google API even though I had undeleted all projects and removed all clients before deleting these again.
This turned out to be a blessing: The solution to this was to recreate my debug key before adding the new fingerprint to Google API in another new client id.
And lo... my original problem went away.
I hade the same problem and for me it worked to re-link the app in Game services -> Linked apps -> Link another app.
You didn't explicitly state that the gmail accounts you're testing with are added as Google Plus users in a Google Plus community that is configured as the testing community for your app -OR- that you're using a google group as the testing community and those gmail accounts are part of that community.
If you have done those things, then it might be the issue stated here:
https://code.google.com/p/google-plus-platform/issues/detail?id=554
This answer might sound encouraging to solve your problem, but don't get your hopes up. I've done all that the original poster did, plus the things above, and I'm still stuck.
I've even followed all of the tips stated here:
Google Play Game Services - unable to sign in
And it would appear the depths of the chasm that Google lets you fall into regarding GPS is far deeper than the depths I've plumbed. Joy.
I had the same problem ,I am not sure that the following action is the one that resolved the problem but its worth the try,
Seems that I didnt had the Drive API enabled ,I had it in the enabled apis but i had to actually click the gear icon next to it and then click enable and provide the application name.
Just link the same package as many times as you have Client ID's in your Developer Console "Debug & Release Client ID's"
The thing is if you link your app to the Game Services with the wrong SHA1 fingerprint, Games Services will pick it up and associate it as the main Client ID.
Once you link the same app again to your Game Services, it will automatically pick up the other Client ID's
I had exactly the same problem, and in my case, I fixed it regenerating the API Key from the Google APIs Console. Go to Credentials, select your API key and then click on "Regenerate Key". You don't need to update anything in your code or link more apps, just regenerate and it starts working magically.

testing google backend engine on phone

I have an existing android app to which I plan to add Google cloud engine backend. I am following the steps as here
https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae.
I used the option "Google-->generate app engine backend" by right clicking on my existing project. and then went forward to test this.
I started the devapp server( I can see it running at localost:8888/_ah/admin/datastore). However When I run my application, I don't see the device registered in the 127.0.0.1:8888. The application runs as it used to run before. I tried both on emulator and on phone but the application just runs as before but I don't see any device registered in my devappserver.
Am I missing anything here?
Some basic steps for application registration were missing in my application. http://developer.android.com/google/gcm/gs.html
Adding them now and that should solve the problem.

Categories

Resources