Kaushik Koneru
Kaushik Koneru

Reputation: 99

Unable to send notification from Facebook App with PHP SDK

I am trying to send Notification to the User , when certain event gets hit .

I have used following code to send Notification , But i am getting a error. Please let me know where i am doing a mistake

Code:

$fb_response = $facebook->api( '/' . $user_id . '/notifications', 'POST', array( 'access_token' => $facebook->getAppId() . '|' . $facebook->getApiSecret(), 'href' => "My_facebook_app_URL", 'template' => "My Message", ));

Error:

FacebookApiException Object
(
    [result:protected] => Array
        (
            [error] => Array
                (
                    [message] => (#10) Notification send blocked.
                    [type] => OAuthException
                    [code] => 10
                )

        )

    [message:protected] => (#10) Notification send blocked.
    [string:private] => 
    [code:protected] => 0

Upvotes: 1

Views: 797

Answers (1)

Mikepote
Mikepote

Reputation: 6553

Try

$facebook->getAppSecret()

Instead of

$facebook->getApiSecret()

maybe?

Upvotes: 1

Related Questions