MCPcopy Create free account
hub / github.com/NativeScript/firebase / Installations

Class Installations

packages/firebase-installations/index.android.ts:19–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 writable: false,
18});
19export class Installations implements IInstallations {
20 _native: com.google.firebase.installations.FirebaseInstallations;
21 _app: FirebaseApp;
22 constructor(app?: FirebaseApp) {
23 if (app?.native) {
24 this._native = com.google.firebase.installations.FirebaseInstallations.getInstance(app.native);
25 } else {
26 if (defaultInstallations) {
27 return defaultInstallations;
28 }
29 defaultInstallations = this;
30 this._native = com.google.firebase.installations.FirebaseInstallations.getInstance();
31 }
32 }
33 delete(): Promise<void> {
34 return new Promise((resolve, reject) => {
35 org.nativescript.firebase.installations.FirebaseInstallations.delete(
36 this.native,
37 new org.nativescript.firebase.installations.FirebaseInstallations.Callback<java.lang.Void>({
38 onSuccess(param0) {
39 resolve();
40 },
41 onError(error) {
42 reject(FirebaseError.fromNative(error));
43 },
44 })
45 );
46 });
47 }
48 getId(): Promise<string> {
49 return new Promise((resolve, reject) => {
50 org.nativescript.firebase.installations.FirebaseInstallations.id(
51 this.native,
52 new org.nativescript.firebase.installations.FirebaseInstallations.Callback<string>({
53 onSuccess(param0) {
54 resolve(param0);
55 },
56 onError(error) {
57 reject(FirebaseError.fromNative(error));
58 },
59 })
60 );
61 });
62 }
63 getToken(forceRefresh = false): Promise<string> {
64 return new Promise((resolve, reject) => {
65 org.nativescript.firebase.installations.FirebaseInstallations.getToken(
66 this.native,
67 forceRefresh,
68 new org.nativescript.firebase.installations.FirebaseInstallations.Callback<com.google.firebase.installations.InstallationTokenResult>({
69 onSuccess(param0) {
70 resolve(param0.getToken());
71 },
72 onError(error) {
73 reject(FirebaseError.fromNative(error));
74 },
75 })
76 );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected