@athletic/capacitor-firebase-realtime 0.0.4 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,19 @@
1
- require 'json'
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = 'AthleticCapacitorFirebaseRealtime'
7
- s.version = package['version']
8
- s.summary = package['description']
9
- s.license = package['license']
10
- s.homepage = package['repository']['url']
11
- s.author = package['author']
12
- s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
- s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '13.0'
15
- s.dependency 'Capacitor'
16
- s.swift_version = '5.1'
17
- end
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'AthleticCapacitorFirebaseRealtime'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['repository']['url']
11
+ s.author = package['author']
12
+ s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
+ s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
+ s.ios.deployment_target = '13.0'
15
+ s.dependency 'Capacitor'
16
+ s.dependency 'FirebaseAuth'
17
+ s.dependency 'FirebaseDatabase'
18
+ s.swift_version = '5.1'
19
+ end
@@ -38,9 +38,6 @@ Examples here:
38
38
 
39
39
  @CapacitorPlugin(name = "CapacitorFirebaseRealtime")
40
40
  public class CapacitorFirebaseRealtimePlugin extends Plugin {
41
-
42
- // private CapacitorFirebaseRealtime implementation = new CapacitorFirebaseRealtime();
43
-
44
41
  private FirebaseAuth fireAuth;
45
42
  private FirebaseDatabase fireDb;
46
43
  private FirebaseUser currentUser = null;
@@ -4,5 +4,8 @@
4
4
  // Define the plugin using the CAP_PLUGIN Macro, and
5
5
  // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
6
  CAP_PLUGIN(CapacitorFirebaseRealtimePlugin, "CapacitorFirebaseRealtime",
7
- CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
7
+ CAP_PLUGIN_METHOD(signOut, CAPPluginReturnPromise);
8
+ CAP_PLUGIN_METHOD(initialize, CAPPluginReturnPromise);
9
+ CAP_PLUGIN_METHOD(signInWithCustomToken, CAPPluginReturnPromise);
10
+ CAP_PLUGIN_METHOD(updateChildren, CAPPluginReturnPromise);
8
11
  )
@@ -10,12 +10,12 @@ import FirebaseDatabase
10
10
  */
11
11
  @objc(CapacitorFirebaseRealtimePlugin)
12
12
  public class CapacitorFirebaseRealtimePlugin: CAPPlugin {
13
- private let implementation = CapacitorFirebaseRealtime()
14
-
15
13
  private var ref: DatabaseReference!
16
14
 
17
15
  override public func load() {
18
- FirebaseApp.configure()
16
+ if (FirebaseApp.app() == nil) {
17
+ FirebaseApp.configure()
18
+ }
19
19
  ref = Database.database().reference()
20
20
  }
21
21
 
@@ -36,7 +36,7 @@ public class CapacitorFirebaseRealtimePlugin: CAPPlugin {
36
36
  if firebaseUserId > 0 && signedInUserId != firebaseUserId {
37
37
  print("CapFire userId mismatch")
38
38
  signOut(call)
39
- firebaseUserId=0
39
+ firebaseUserId = 0
40
40
  }
41
41
  call.resolve(["signedIn": firebaseUserId])
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athletic/capacitor-firebase-realtime",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "description": "Capacitor Firebase Realtime plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,11 +0,0 @@
1
- package net.athletic.firebase.realtime;
2
-
3
- import android.util.Log;
4
-
5
- public class CapacitorFirebaseRealtime {
6
-
7
- public String echo(String value) {
8
- Log.i("Echo", value);
9
- return value;
10
- }
11
- }
@@ -1,8 +0,0 @@
1
- import Foundation
2
-
3
- @objc public class CapacitorFirebaseRealtime: NSObject {
4
- @objc public func echo(_ value: String) -> String {
5
- print(value)
6
- return value
7
- }
8
- }