No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.esm2017.js 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import firebase from '@firebase/app-compat';
  2. import { Component } from '@firebase/component';
  3. import { getId, getToken, deleteInstallations, onIdChange } from '@firebase/installations';
  4. const name = "@firebase/installations-compat";
  5. const version = "0.2.1";
  6. /**
  7. * @license
  8. * Copyright 2020 Google LLC
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. */
  22. class InstallationsCompat {
  23. constructor(app, _delegate) {
  24. this.app = app;
  25. this._delegate = _delegate;
  26. }
  27. getId() {
  28. return getId(this._delegate);
  29. }
  30. getToken(forceRefresh) {
  31. return getToken(this._delegate, forceRefresh);
  32. }
  33. delete() {
  34. return deleteInstallations(this._delegate);
  35. }
  36. onIdChange(callback) {
  37. return onIdChange(this._delegate, callback);
  38. }
  39. }
  40. /**
  41. * @license
  42. * Copyright 2020 Google LLC
  43. *
  44. * Licensed under the Apache License, Version 2.0 (the "License");
  45. * you may not use this file except in compliance with the License.
  46. * You may obtain a copy of the License at
  47. *
  48. * http://www.apache.org/licenses/LICENSE-2.0
  49. *
  50. * Unless required by applicable law or agreed to in writing, software
  51. * distributed under the License is distributed on an "AS IS" BASIS,
  52. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  53. * See the License for the specific language governing permissions and
  54. * limitations under the License.
  55. */
  56. function registerInstallations(instance) {
  57. instance.INTERNAL.registerComponent(new Component('installations-compat', container => {
  58. const app = container.getProvider('app-compat').getImmediate();
  59. const installations = container
  60. .getProvider('installations')
  61. .getImmediate();
  62. return new InstallationsCompat(app, installations);
  63. }, "PUBLIC" /* ComponentType.PUBLIC */));
  64. instance.registerVersion(name, version);
  65. }
  66. registerInstallations(firebase);
  67. //# sourceMappingURL=index.esm2017.js.map