Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9039187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:40:19+00:00 2026-06-16T09:40:19+00:00

I am using GCM to send notification to android devices. The code that I

  • 0

I am using GCM to send notification to android devices.

The code that I am using to get the message in GCMIntentService is as below:

@Override
    protected void onMessage(Context ctx, Intent intent) {
        // TODO Auto-generated method stub
        String j =intent.getStringExtra("message");
        generateNotification(ctx, j);
    }

And the code that I am using in server side to push or send those notification is as below:

Dim request As WebRequest = WebRequest.Create("https://android.googleapis.com/gcm/send")
request.Method = "POST"
request.ContentType = "application/x-www-form-urlencoded"
request.Headers.Add("Authorization: key=AIzaSyA47-XMaePL1mmI0P1yQ9V4sntMVn9q-1o")
request.Headers.Add("Sender: id=648406549877")
Dim collapsKey = Guid.NewGuid.ToString("n")
Dim postdata As String = "registration_id=" + regid_String_reveived_from_device_after_registering_with_GCM + "&data.message=" + TextBox1.Text + "&collapse_key=" + collapsKey
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postdata)
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim resposne As WebResponse = request.GetResponse
Dim dataresponse As Stream = resposne.GetResponseStream
Dim reader As New StreamReader(dataresponse)
Dim sResponseFromServer As String = reader.ReadToEnd
Label2.Text = sResponseFromServer
reader.Close()
dataresponse.Close()
resposne.Close

When I sent any notification in English Language using the above code I received it in my device with no problem at all, But When I sent notification in Arabic language using the above code I got nothing as message which appear to me as blank in both Logcat and notification. The android API that I am using to develop this app is 16.

So how can I get the message that written in Arabic as notification, the same way that I get those messages when sent by English.

Is the problem from ASP.Net Side or android Side.

Any help or redirection will be completely appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:40:20+00:00Added an answer on June 16, 2026 at 9:40 am

    I solved the above problem which I was facing for one week by doing the following:

    the message that I sent from the ASP.net side which is represented as TextBox1.Text placed in the request’s body and it needs to be URL Encoded, since that I just encoded the TextBox1.Text value which solve my problem and let my android app received notification in arabic languge:

    I only changed my asp.net code from this:

    Dim postdata As String = "registration_id=" + regid(i) + "&data.message=" + TextBox1.Text + "&collapse_key=" + collapsKey
    

    To be Like the following:

    Dim postdata As String = "registration_id=" + regid(i) + "&data.message=" + HttpUtility.UrlEncode(TextBox1.Text) + "&collapse_key=" + collapsKey
    

    and keep my android code as its.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I receiving notification using GCM in android. When i get two notifications together, second
I've follow this code: How to get RegistrationID using GCM in android but i
I have two android devices that runs a gcm client app. I get the
im trying to test push notification using GCM in android device. Just i run
I have an application with login/logout that uses android's Accounts. I'm using GCM too,
I'm trying to send push notification to Android devices, but getting an error in
Building an Android application using Google's GCM service. I have implemented the onRegistered method
The application prepared by me is using GCM to get push notifications from the
I am trying to use the GCM service in my android app. For that,
I'm an android developer and currently working on GCM server side using PHP. From

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.