How to Change the Authentication Settings from C2DM Server to GCM Server in Afaria 7
- Customers have upgraded from (Afaria 6.6 or Afaria 7 SP1) to (Afaria 7 SP2 or SP3).
- Customers faces errors while testing the GCM server such as device lock and apply policies are not applied successfully.
- customers might skip some steps while setting up the GCM server.
* Procedure Steps
1.0 Setting up the GCM Authentication Method
1. 1 Google API
1. Navigate to https://code.google.com/apis/console/ and click the API Console button
2. To get started, you will need a Google account and will need to create a new API project:
3. Once your project has been created, enable the URL Shortener API and the Google Cloud Messaging for Android APIs.
Figure 1: Creating Google API Project
4. You will now need to go to the API Access tab and create both a server apps key and a browser apps key.
5. Note these for later.
1.2 GCM Configuration
Navigate to Afaria Admin > Server > Configuration > Component > GCM Server
- Click Enable GCM
- Enter the correct server address: https://android.googleapis.com/gcm/send
- Enter your project ID from your Google API project
- Enter your server API key from the Google API project
Figure 2: Obtaining the Project ID
Figure 3: The Authorized API Access Two Server Keys
5. Enable the Google Cloud Messaging for Android Service. To do this click on the Services Link and ensure the Google Cloud Messaging Service is enabled:
Figure 4: GOOGLE CLOUD MESSAGING FOR ANDROID = ENABLED
Now, navigate to Afaria Admin > Server > Configuration > Component > GCM Server and copy in the server key into the Google API key field.
This is how the GCM Server configuration page should look:
Figure 5: Afaria Admin Console GCM Server
2.0 Installing Afaria Server
Use the Afaria 7 Installation guide to setup the Afaria Server, Administrator, API Services, and Package Server. The Afaria 7 install can be found in the Internal Software section on the www.frontline.sybase.com website.
The installation guide can be found here: [install directory]\ Documents\English\Product manuals
To get a device working with Afaria, you will want to send it an enrollment code that it can use. Having enabled the Google URL service, you will be able to use both TinyURL and Google to send these codes.
Click Server > configuration > Server > Enrollment Code
- Enable TinyURL and test the connection
- Enable Google URL by putting in your API key and test the connection.
- Navigate to Home > Policies
- Create an Enrollment Policy for an Android Device
- ADD an enrollment code, with the expiry and portal use options you wish (default is fine).
- In the Groups section, link the policy to a group of devices
Figure 6: Enrollment Policy
On your device, input the enrollment code into the device and connect.
You can also manually configure an Android device to connect to your Afaria Server by inputting the server address, port, host-name, relay server name etc. on the device directly.
Changing the Authentication Settings from C2DM to GCM in Afaria 7
* Afaria Solution Summary
1. Setup Afaria sever. In your Afaria Admin, go to Server > Component > GCM Server. Enable the GCM, in your case C2DM. I am not sure how he still has C2DM even though he had GCM in the screenshots you sent me before. Make sure that he fill in the correct information in these fields illustrated in my screenshot. Restart the server, and Save your data.
Figure 7: GCM Server
2. Enroll customer’s device. Go to Policy tab, and click on your Android Enrollment policy. In the General tab, click on the GCM Project ID. In the Address textbook, your customer doesn’t have a relay server, so that he has to enter his Afaria address to pick the GCM info, then Save your changes.
Figure 8: Enrollment Server Adress & GCM Project ID
3. Add GCM details to the Afaria server to make the appropriate changes to the seed data page in the configuration manager. Connect the device and pick up seed data. In your Policy tab, and click on your Android Configuration policy. In the Android tab, click on Device Communication. Enable see data. Also, fill in the server textbook in this format Afaria server address: proxy, since your customer doesn’t have a relay server. In addition include the Farm ID and GCM project ID that are used for communication between the Afaria server and channels.
Figure 9: Configuration Device Communication
4. Test the GCM command such as device lock and lock was applied successfully.
5. In Sybase Central, open the A_CONFIGURATION_PROPERTY table, select Data, and ensure that C2DMServerAddress, C2DMEmailAddress and C2DMPassword have GCM info passed there.
Figure 10: A_CONFIGURATION_PROPERTY Table