Home facebook sdk api and nativeoffers
Reply: 0

facebook sdk api and nativeoffers

user1027
1#
user1027 Published in May 27, 2018, 1:25 am

I have problem with creating facebook page offer. It return ID of post, but i can not find it on facebook. I found information only here: https://developers.facebook.com/docs/graph-api/reference/native-offer/ But when i creating it on facebook, it require a photo. Photo url is not included in source

$params = array(
'location_type' => 'both',
'discounts' => array(
    array(
        'type' => 'percentage_off',
        'text' => 'the text description for this offer',
        'value1' => 20,
    ),

),
'redemption_link' => 'www.link.com',
'redemption_code' => 'happysummer2016',
'details' => 'the details for this specific offer',
'expiration_time' => (new \DateTime("+10 day"))->getTimestamp(),
);

$pages=getPages($fb);
foreach ($pages as $key) {
if ($key['name'] == 'name') {
    $post = $fb->post('/' . $key['id'] . '/nativeoffers', $params, $key['access_token']);
    $post = $post->getGraphNode()->asArray();
    print_r($post);
}
} 
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303278 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO