2018-02-02 08:40:48 +00:00
|
|
|
/**
|
|
|
|
* @flow
|
|
|
|
* Instance ID representation wrapper
|
|
|
|
*/
|
|
|
|
import ModuleBase from '../../utils/ModuleBase';
|
|
|
|
import { getNativeModule } from '../../utils/native';
|
|
|
|
|
2018-02-15 14:59:21 +00:00
|
|
|
import type App from '../core/app';
|
2018-02-02 08:40:48 +00:00
|
|
|
|
|
|
|
export const MODULE_NAME = 'RNFirebaseInstanceId';
|
2018-03-23 14:59:00 +00:00
|
|
|
export const NAMESPACE = 'iid';
|
2018-02-02 08:40:48 +00:00
|
|
|
|
|
|
|
export default class InstanceId extends ModuleBase {
|
|
|
|
constructor(app: App) {
|
|
|
|
super(app, {
|
2018-03-23 13:24:31 +00:00
|
|
|
hasShards: false,
|
2018-02-02 08:40:48 +00:00
|
|
|
moduleName: MODULE_NAME,
|
|
|
|
multiApp: false,
|
|
|
|
namespace: NAMESPACE,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
delete(): Promise<void> {
|
|
|
|
return getNativeModule(this).delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
get(): Promise<string> {
|
|
|
|
return getNativeModule(this).get();
|
|
|
|
}
|
2018-05-26 19:05:19 +00:00
|
|
|
|
|
|
|
getToken(authorizedEntity: string, scope: string): Promise<string> {
|
|
|
|
return getNativeModule(this).getToken(authorizedEntity, scope);
|
|
|
|
}
|
|
|
|
|
|
|
|
deleteToken(authorizedEntity: string, scope: string): Promise<void> {
|
|
|
|
return getNativeModule(this).deleteToken(authorizedEntity, scope);
|
|
|
|
}
|
2018-02-02 08:40:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const statics = {};
|