http://mb.cloud.nifty.com/doc/current/rest/common/format.html
Use Nifty mobile backend 's REST API to correspond to React Native
yarn add react-native-ncmb
import NCMB from 'react-native-ncmb';
NCMB.set({
applicationkey: 'abcdefghijklmnopqrstuvwxyz0123456789',
clientKey: 'abcdefghijklmnopqrstuvwxyz0123456789',
});
NCMB.user.login({
userName: 'user01',
password: 'test1234'
}).then(response => {
console.log(response)
}).catch(error => {
// type Error
});
{
"objectId":"09Mp23m4bEOInUqT",
"userName":"user01",
"mailAddress":null,
"mailAddressConfirm":null,
"sessionToken":"ebDH8TtmLoygzjqjaI4EWFfxc",
"createDate":"2013-08-28T07:46:09.801Z",
"updateDate":"2013-08-30T05:32:03.868Z"
}
NCMB.user.logout()
.then(response => {
console.log(response)
}).catch(error => {
// type Error
});
// type Promise
NCMB.user.create({
userName: 'user01',
password: 'test1234'
})
.then(response => {
console.log(response)
}).catch(error => {
// type Error
});
{
"createDate":"2013-08-28T11:27:16.446Z",
"objectId":"epaKcaYZqsREdSMY",
"sessionToken":"iXDIelJRY3ULBdms281VTmc5O",
"userName":"user01",
"authData":null
}
NCMB.user.read()
.then(response => {
console.log(response)
}).catch(error => {
// type Error
});
{
"objectId":"epaKcaYZqsREdSMY",
"userName":"YamadaTarou",
"authData":null,
"mailAddress":null,
"mailAddressConfirm":null,
"createDate":"2013-08-28T11:27:16.446Z",
"updateDate":"2013-08-28T12:03:28.926Z",
"acl":{
"*":{
"read":true,
"write":true
}
}
}
NCMB.user.update({
mailAddress: "new_address@mail"
etc...
}).then(response => {
console.log(response)
}).catch(error => {
// type Error
});
{"updateDate":"2013-08-28T12:21:17.087Z"}
NCMB.user.delete()
.then(response => {
console.log(response)
}).catch(error => {
// type Error
});
// type Promise
NCMB.user.requestPasswordReset({
mailAddress: '[email protected]'
}).then(response => {
console.log(response)
}).catch(error => {
// type Error
});
{"createDate":"2013-09-04T04:31:43.371Z"}
NCMB.user.requestMailAddressUserEntry({
mailAddress: '[email protected]'
}).then(response => {
console.log(response)
}).catch(error => {
// type Error
});
{"createDate":"2013-09-04T04:31:43.371Z"}