CodeExplorer registerWithApp example
{ } public function registerApp(Manifest
$manifest, string
$id, string
$secretAccessKey, Context
$context): void
{ if (!
$manifest->
getSetup()) { return;
} try { $appName =
$manifest->
getMetadata()->
getName();
$appResponse =
$this->
registerWithApp($manifest,
$context);
$secret =
$appResponse['secret'
];
$confirmationUrl =
$appResponse['confirmation_url'
];
$this->
saveAppSecret($id,
$context,
$secret);
$this->
confirmRegistration($id,
$context,
$secret,
$secretAccessKey,
$confirmationUrl);
} catch (RequestException
$e) { if ($e->
hasResponse() &&
$e->
getResponse() !== null
) { $response =
$e->
getResponse();
$data =
json_decode($response->
getBody()->
getContents(), true
);