PHP code example of mirovit / ionic-platform-sdk

1. Go to this page and download the library: Download mirovit/ionic-platform-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mirovit / ionic-platform-sdk example snippets




 default, if a token is not passed in the constructor,
// the class will try to load the token from
// IONIC_TOKEN environment variable. The second param,
// the API endpoint is set as default value to
// https://api.ionic.io/, which is the current endpoint:
$sdk = new Mirovit\IonicPlatformSDK\IonicPlatformSDK();
// or explicitly them:
$sdk = new Mirovit\IonicPlatformSDK\IonicPlatformSDK(
    'ionic_api_token',
    'api_endpoint'
);

// Retrieve an user
$user = $sdk
            ->users()
            ->get('user-uuid-from-ionic');

// Create an user
$newUser = $sdk
            ->users()
            ->create([
                'app_id'    => 'your_app_id',
                'email'     => '[email protected]',
                'password'  => 'very_secret_passw0rd',
            ]);



// http://docs.ionic.io/docs/api-users#users-list
$sdk
    ->users()
    ->all();

// http://docs.ionic.io/docs/api-users#users-get
$sdk
    ->users()
    ->get('user-uuid');

// http://docs.ionic.io/docs/api-users#users-self
$sdk
    ->users()
    ->self();

// http://docs.ionic.io/docs/api-users#users-post
$sdk
    ->users()
    ->create([
        //   ->update([
        // ;

// http://docs.ionic.io/docs/api-users#users-custom-get
$sdk
    ->users()
    ->getCustom('user-uuid');

// http://docs.ionic.io/docs/api-users#users-custom-put
$sdk
    ->users()
    ->setCustom([
        // 


// http://docs.ionic.io/docs/api-push#notifications-list
$sdk
    ->push()
    ->notifications()
    ->all();

// http://docs.ionic.io/docs/api-push#notifications-get
$sdk
    ->push()
    ->notifications()
    ->get('notification-uuid');

// http://docs.ionic.io/docs/api-push#notifications-list-messages
$sdk
    ->push()
    ->notifications()
    ->messages('notification-uuid');

// http://docs.ionic.io/docs/api-push#notifications-post
$sdk
    ->push()
    ->notifications()
    ->create([

    ]);

// http://docs.ionic.io/docs/api-push#messages-list
$sdk
    ->push()
    ->messages()
    ->all();

// http://docs.ionic.io/docs/api-push#messages-get
$sdk
    ->push()
    ->messages()
    ->get('message-uuid');

// http://docs.ionic.io/docs/api-push#tokens-list
$sdk
    ->push()
    ->tokens()
    ->all();

// http://docs.ionic.io/docs/api-push#tokens-get
$sdk
    ->push()
    ->tokens();

// http://docs.ionic.io/docs/api-push#tokens-patch
$sdk
    ->push()
    ->tokens()
    ->validate('token-uuid');

$sdk
    ->push()
    ->tokens()
    ->invalidate('token-uuid');

$sdk
    ->push()
    ->tokens()
    ->changeStatus('token-uuid', 'status');

// http://docs.ionic.io/docs/api-push#tokens-post
$sdk
    ->push()
    ->tokens()
    ->save('token-string', 'user-uuid');

// http://docs.ionic.io/docs/api-push#tokens-delete
$sdk
    ->push()
    ->tokens()
    ->delete('token-uuid');



// http://docs.ionic.io/docs/api-deploy#channels-list
$sdk
    ->deploy()
    ->channels()
    ->all();

// http://docs.ionic.io/docs/api-deploy#channels-get
$sdk
    ->deploy()
    ->channels()
    ->get('channel-uuid');

// http://docs.ionic.io/docs/api-deploy#channels-get-tag
$sdk
    ->deploy()
    ->channels()
    ->tag('tag');

// http://docs.ionic.io/docs/api-deploy#channels-post
$sdk
    ->deploy()
    ->channels()
    ->create([

    ]);

// http://docs.ionic.io/docs/api-deploy#channels-edit
$sdk
    ->deploy()
    ->channels()
    ->update([

    ]);

// http://docs.ionic.io/docs/api-deploy#channels-delete
$sdk
    ->deploy()
    ->channels()
    ->delete('channel-uuid');

// http://docs.ionic.io/docs/api-deploy#snapshots-list
$sdk
    ->deploy()
    ->snapshots()
    ->all();

// http://docs.ionic.io/docs/api-deploy#snapshots-get
$sdk
    ->deploy()
    ->snapshots()
    ->get('snapshot-uuid');

// http://docs.ionic.io/docs/api-deploy#snapshots-edit
$sdk
    ->deploy()
    ->snapshots()
    ->update([

    ]);

// http://docs.ionic.io/docs/api-deploy#deploys-list
$sdk
    ->deploy()
    ->deploys()
    ->all('channel-uuid');

// http://docs.ionic.io/docs/api-deploy#deploys-post
$sdk
    ->deploy()
    ->deploys()
    ->set('channel-uuid', 'snapshot-uuid');

// http://docs.ionic.io/docs/api-deploy#deploys-delete
$sdk
    ->deploy()
    ->deploys()
    ->delete('deploy-uuid');