I can not connect Google Cloud Messaging to Android client - android

I'm trying to create a simple example to work with Google Cloud Messaging to Android. I have a php server that is to send a notification android client. I can not understand how the petroleum products in android. I found examples but can not start them. I tried gradle project creation. wrote dependence:
compile 'com.google.android.gms:play-services:6.1.71'
and he found it. but the classes are not available from the library anyway.
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver"
Android Studio not find and:
GCMBaseIntentService and GCMConfig not find too
I created a project ant. android sdk Extras->Google Play Services and took away the library:
AndroidSDK\extras\google\google_play_services\libproject\google-play-services_lib\libsgoogle-play-services.jar
and connect it. but the same error.
What am I doing wrong? tell me how to set up and connect to the android client Google Cloud Messaging?

Related

No clients were able to be added to your Firebase project

I recently released an Android App on the playstore this app is currently linked with both Google's Admob and Google's firebase for analytics, after a while I started working on an update that includes FIREBASE NOTIFICATIONS when I tried to connect firebase to the project I got this error:
Firebase
No clients were able to be added to your Firebase project for the following reasons:
An app with this package name and SHA1 is already connected to a Google project. If you have used a Google API previously, please select that project in the Connect to an existing project list.
Client Package Name: xxxxxxxxxxxxxxxxxxxxxxxxx
Client SHA1: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
How to fix this without loosing my previous analytics stats ?
You Should Use The existing App And Include Feature For Push Notifications at Firebase console or firebase assistant in studio
As you are creating a new project in firebase assistant for push notifications but you have aldready added this app for another services it Wont use two firebase projects for Single application so Make Sure You Are Going With The Past Project which you have done for admob and then go to cloud messaging amd enable it then you will successfully connect
If any errors again i can Help
Thank you
And If You Created Aldready you can import that project into previous project but make sure that you use same firebase account
https://firebase.google.com/support/faq/
Use this link to know about importing projects

How do I add Firebase Cloud Messaging to Xamarin.Forms app?

Google has replaced GCM (Google Cloud Messaging) with the new FCM (Firebase Cloud Messaging) for push notifications. I am trying to implement push notifications in my Android (Xamarin.Forms) project. It appears that FCM is not yet supported for Forms due to Google Play Services dependency issues (see details below). When I attempt to implement using the old GCM system, the Google Developer Console will not allow me access the GCM API credentials page (just redirects me to FCM). Does anyone have any suggestions to get push notifications working with Android in a Xamarin.Forms solution?
Note: I am using Azure Notification Hub to send the messages (I have iOS already working)
Dependency Issue: The latest Xamarin.Forms package is dependent on Xamarin.Android.Support.v4 (23.3.0). Xamarin.Firebase.Messaging is dependent on Xamarin.GooglePlayServices.Basement (32.961.0). Xamarin.GooglePlayServices.Basement (32.961.0) is dependent on Xamarin.Android.Support.v4 (>=24.2.1).
My android solution is on:
https://forums.xamarin.com/discussion/70248/firebase-configuration
Just search for my name as UmutBebek. I'm using pushSharp to send push-notifications from my own server. There is a simple example for that too.
Almost a year later and this should not be an issue anymore.
I have a Xamarin Forms (2.4.0) app pegging Xamarin.Android.Support v4 at version 25.1.0 and I just installed Xamarin.Firebase.Messaging (42.1021.1) happily alongside it via nuget.

Google Cloud endpoints module to Google Cloud module with GCM?

I have an app with a regular Google Cloud Endpoints module. Everything works fine. But recently, I found out that I need to have GCM service for the app. Is it possible to convert the Google Cloud Endpoints module to a Google Cloud messaging module? Or should I have both modules and deploy in different cloud projects? Or should I just set up the whole backend again with a GCM module? I am using Android Studio with Gradle btw.
You can add your new API to your existing module; you don't have to do anything special.

Google Clould Message demo setup : Dependencies not found

I want to integrate GCM into my android app. For the beginning I wanted to test the GCM demo that comes with the Google tutorial on how to use GCM http://developer.android.com/google/gcm/client.html
I downloaded the demo project an imported it into my ADT eclipse. So this is what I did:
I downloaded the "Google Play services" via SDK Manager and additionally "Google Repository"
I copied the "/extras/google/google_play_services/libproject/google-play-services_lib/" into my workspace (as recommended by the tutorial)
On the following screenshot you can see that I added the copy of "google-play-services_lib" as a Library to the GCM demo project
However, the dependencies are not resolved as the following screenshot shows:
So at what point in the instructions chain did I make an error?
Google Play Services doesn't contain GCMRegistrar class. That class is part of the deprecated GCM Client library. Instead of using GCMRegistrar, use com.google.android.gms.gcm.GoogleCloudMessaging class to register to GCM.
You are using an old version of the GCM Demo. Try the current version here.
Please follow GCM sample code from here

mobile backend starter import to android studio

This is my first post in StackOverflow.
I am building an android app using Android Studio. This app requires some cloud backend to sync user data across devices. After some research, I came across the Mobile Backend Starter from google which provides a fully deployed app engine backend and a client android application.
The problem is that every video/tutorial out there is using Eclipse to open this client application. When you try to import it to Android Studio, you get an Assertion:Null error.
Another step I tried is that, I opened it in Eclipse, followed google documentation to set
And then tried to import to Android Studio. This time I got an error that the "The filename, directory name, or volume label syntax is incorrect"
Can someone help me out with this? Is it also possible to use the "Generate Mobile Backend" option in android studio? But wouldnt this mean that we cannot leverage the client libraries provided in Mobile Backend Starter?
Edit (to add more details to the question):
If I use the "Tools > Google Cloud Tools > Generate App Engine Backend" method, will I be able to get all the boiler plate code in the Mobile Backend android client?
Also, I tried today to Generate App Engine Backend and point to my existing Mobile Backend Starter app engine project. But this did not bring in end point connections for mobilebackend api. Am I missing something here?
Yes there is an option in Android Studio also for Generating App Engine Backend.
Tools > Google Cloud Tools > Generate App Engine Backend
Here is a nice tutorial on Android Blog for the same
http://android-developers.blogspot.in/2013/06/adding-backend-to-your-app-in-android.html
But look in to this post before doing this as Google App Engine Back-end still uses maven so you need to install that before using it.
Maven needed when generating Google App Engine backend in Android Studio
This is an old question but for those that come to this now the easiest way to get started is with this unofficial build for android studio. Why couldn't google do this themselves?
https://github.com/thagikura/mobile-backend-starter-android-client-with-AndroidStudio

Categories

Resources