-
Notifications
You must be signed in to change notification settings - Fork 8
Home
Armando Assunção edited this page Feb 20, 2018
·
5 revisions
import { MAS, MASdevice, MASUser } from 'react-native-ca-mas';
MAS.debug()
MAS.getState()
.then((t) => console.log('state:', t))
.catch((e) => console.log('state error:', e))
MAS.isAuthenticationListenerRegistered()
.then(res => console.log(res))
.catch(error => console.log(error))
MAS.invoke(path: string, {
method: string, // default: 'GET'
headers: object, // default: null
body: object, // default: null
})
MAS.invoke('/foo', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: {
foo: 123,
}
})
.then(res => console.log(res))
.catch(error => console.log(error))
MASUser.deregister()
.then(res => console.log(res))
.catch(error => console.log(error))
MASUser.getIdentifier()
.then(res => console.log(res))
.catch(error => console.log(error))
MASUser.isRegistered()
.then(res => console.log(res))
.catch(error => console.log(error))
MASUser.resetLocally()
MASUser.getCurrentUser()
.then(res => console.log(res))
.catch(error => console.log(error))
MASUser.getAuthCredentialsType()
.then(res => console.log(res))
.catch(error => console.log(error))
MASUser.login('mark', 'dadada')
.then(res => console.log(res))
.catch(error => console.log(error))