跳到主要内容

bn.getSetting

getSetting(): Promise<Settings>

description Gets the user's current settings. The return value only contains what the Mini Program has already requested from the user.

example

const res = await bn.getSetting()
console.log(res.authSetting['scope.userLocation']) // boolean

Returns

Promise<Settings>


Settings

Ƭ Settings: Object

Type declaration

NameTypeDescription
authSettingAuthSettingsResult of user's permission

AuthSettings

Ƭ AuthSettings: Object

Type declaration

NameTypeDescription
scope.camera?booleancamera
scope.userLocation?booleanphysical location
scope.writePhotosAlbum?booleanadd picture to photo album