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 6724139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:39:09+00:00 2026-05-26T09:39:09+00:00

i’m trying to send app-generated notifications to my app users using the code: $app_id

  • 0

i’m trying to send app-generated notifications to my app users using the code:

$app_id = MY_APP_ID;
$app_secret = MY_APP_SECRET;

$token_url = "https://graph.facebook.com/oauth/access_token?" .
    "client_id=" . $app_id .
    "&client_secret=" . $app_secret .
    "&grant_type=client_credentials";

$app_access_token = file_get_contents($token_url);

$user_id = SOME_USER_ID;

$apprequest_url ="https://graph.facebook.com/" .
    $user_id .
    "/apprequests?message='a message'" . 
    "&data='some_data'&"  .   
    $app_access_token . "&method=post";

$result = file_get_contents($apprequest_url);

var_dump($result);

The user authentification is ok, also i’m getting a valid access token, but when i call

$result = file_get_contents($apprequest_url);

The response i get is:

Method Not Implemented
Invalid method in request

Any ideas what can be happening? If I put the url in a browser, it works fine and i generate the notification.

Thanks in advance

  • 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-05-26T09:39:10+00:00Added an answer on May 26, 2026 at 9:39 am

    I found the error while sending notifications… It’s a bit silly but the problem was me trying to put white spaces in the message string I was using to make the API call.
    I mean, it will work by replacing ‘ ‘ by ‘%20’. I also tried unssucessfully encoding the message previously with

    utf8_encode($message)
    

    But it didn’t work. So the solution for me was directly replacing spaces in my string, it’s not an ellegant solution. But i’ve spent like 10 hours dealing with this so…

    I.e.

    "/apprequests?message='a message'" . 
    

    replaced by:

    "/apprequests?message='a%20message'" .
    

    I hope this help someone else and the time i spent making a thousand tests was not wasted xD

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.