跳到主要内容

bn.authorize

authorize(scope): Promise<{}>

description Request user's authorization. Once called a dialog will be promoted to ask for access to user's data. If users have granted the authorization before, the dialog will not be shown and return success immediately.

example

bn.authorize({ scope: 'scope.userLocation' })
.then(res => console.log(`[authorize] SUCCESS:`, res))
.catch(err => console.log(`[authorize] ERROR:`, err))

Parameters

NameType
scopeAuthOptions

Returns

Promise<{}>


AuthOptions

Ƭ AuthOptions: Object

Type declaration

NameTypeDescription
scopestringThe scope of authorization requested. e.g scope.userLocation