...
Support user's profile submenu
Implement hooks "mobile.service_userapi_getprofilemenu_end.php" using the following example code to add a menu to the user's profile page
Code Block | ||||
---|---|---|---|---|
| ||||
<?php /** * Add post navigation to user profile menu */ if (isset($query) && isset($local) && isset($result) && Phpfox::isModule('post') && isset($user)) { $result['post'] = [ 'label' => $local->translate("posts"), 'path' => "post/list-item", 'params' => [ 'headerTitle' => $local->translate('full_name_s_item', ['full_name' => $user['full_name'], 'item' => $local->translate("posts")]), 'query' => $query, ], ]; } |
Verify User Detail Api to make sure that your code works with API Call: /user/{user_id}?access_token={{token}}
Support pages detail app submenu
if If your app integrate when is integrated to Pages app, In in this case, we need to add a menu to view all items belong belonging to the page and a button to allow to create a new post in page
Add Let's add new Hook "/mobile.service_pageapi_getprofilemenu_end.php" in your phpFox app using the following code
...
Now, verify Get Detail Pages API to make sure it has response your integrationresponds details of the integrated app
API Call: /pages/1?access_token={{token}}
Support groups detail app submenu
if If your app integrates is integrated with Groups app. we , you need to add a menu to view all items belong belonging to the group and a button to allow to create a new post in the group
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?php if (isset($query) && isset($local) && isset($result) && Phpfox::isModule('post') && isset($page)) { $result['post'] = [ 'label' => $local->translate("posts"), 'path' => "post/list-item", 'params' => [ 'headerTitle' => $local->translate('full_name_s_item', ['full_name' => $page['title'], 'item' => $local->translate("posts")]), 'query' => $query, // Add create button 'headerRightButtons' => [ [ 'icon' => 'plus', 'action' => Screen::ACTION_ADD, 'params' => [ 'resource_name'=> 'post', 'module_name'=> 'post', 'query' => [ 'item_id' => $page['page_id'], 'module_id' => 'pages' ] ] ] ] ], ]; } |
Now, you can verify Get Detail Groups API to make sure it has response your integration
API Call: /groups/{group_id}?access_token={{token}}
The response would be the same as one of Pages integration