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

  • Home
  • SEARCH
  • 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 7892187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:48:26+00:00 2026-06-03T06:48:26+00:00

Hello there i’m writing a code for c2dm with php this is the code

  • 0

Hello there i’m writing a code for c2dm with php this is the code in drupal module, my problem is it is working on my localhost “wamp” server but when try using it on my centos 5 server, the var_dump($response) returns bool(false), my domain is certified and curl is working well on my server, is there any solution for my case?

function push_notifications_c2dm_token() {
  $data = array(
    'Email'         => PUSH_NOTIFICATIONS_C2DM_USERNAME,
    'Passwd'        => PUSH_NOTIFICATIONS_C2DM_PASSWORD,
    'accountType'   => 'HOSTED_OR_GOOGLE',
    'source'        => 'Company-AppName-Version',
    'service'       => 'ac2dm',
  );

  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, PUSH_NOTIFICATIONS_C2DM_CLIENT_LOGIN_ACTION_URL);
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($curl, CURLOPT_POST, TRUE);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  $response = curl_exec($curl);
  var_dump($response); die();
  curl_close($curl);

  // Get the auth token.
  preg_match("/Auth=([a-z0-9_\-]+)/i", $response, $matches);
  $auth_token = $matches[1];

  if (!$auth_token) {
    watchdog('push_notifications', 'Google C2DM Server did not provide an authentication token.', NULL, WATCHDOG_ERROR);
  }
  else {
    return $auth_token;
  }
}
  • 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-03T06:48:27+00:00Added an answer on June 3, 2026 at 6:48 am

    You could use curl_error() (http://www.php.net/manual/en/function.curl-error.php) to find the problem in your code. The false boolean returned by the curl_exec() is not giving enough information to solve the problem.

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

Sidebar

Related Questions

For example, I want to have code like this: class Class1 { Class2.print(Hello there.);
I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
Hello I am looking to see if there are any modules for drupal 6
Hello there i have written some code in jquery to add new input type
Hello there i got some code here; <script type=text/javascript> $(function(){ var playListURL = 'http://gdata.youtube.com/feeds/api/playlists/8BCDD04DE8F771B2?v=2&alt=json&callback=?';
hello there is something i've realized with quartz when working.Say a cron is set
Hello there I am working on an assignment in C where I need to
Hello there i'm having a problem here i have an add and edit form
Hello there I have the following code: struct Edge { Node * nodeA, *
Hello there android experts, I have a problem for some time and after some

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.