369
 				CODE_SIGN_STYLE = Automatic;
349
 				CURRENT_PROJECT_VERSION = 1;
370
 				CURRENT_PROJECT_VERSION = 1;
350
 				DEVELOPMENT_TEAM = 5QTJEGL2H2;
371
 				DEVELOPMENT_TEAM = 5QTJEGL2H2;
351
 				INFOPLIST_FILE = App/Info.plist;
372
 				INFOPLIST_FILE = App/Info.plist;
352
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
373
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
353
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
374
+				LD_RUNPATH_SEARCH_PATHS = (
375
+					"$(inherited)",
376
+					"@executable_path/Frameworks",
377
+				);
354
 				MARKETING_VERSION = 1.0;
378
 				MARKETING_VERSION = 1.0;
355
 				OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
379
 				OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
356
 				PRODUCT_BUNDLE_IDENTIFIER = net.simplico.tmtlive;
380
 				PRODUCT_BUNDLE_IDENTIFIER = net.simplico.tmtlive;
366
 			baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
390
 			baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
367
 			buildSettings = {
391
 			buildSettings = {
368
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
392
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
393
+				CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
369
 				CODE_SIGN_STYLE = Automatic;
394
 				CODE_SIGN_STYLE = Automatic;
370
 				CURRENT_PROJECT_VERSION = 1;
395
 				CURRENT_PROJECT_VERSION = 1;
371
 				DEVELOPMENT_TEAM = 5QTJEGL2H2;
396
 				DEVELOPMENT_TEAM = 5QTJEGL2H2;
372
 				INFOPLIST_FILE = App/Info.plist;
397
 				INFOPLIST_FILE = App/Info.plist;
373
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
398
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
374
-				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
399
+				LD_RUNPATH_SEARCH_PATHS = (
400
+					"$(inherited)",
401
+					"@executable_path/Frameworks",
402
+				);
375
 				MARKETING_VERSION = 1.0;
403
 				MARKETING_VERSION = 1.0;
376
 				PRODUCT_BUNDLE_IDENTIFIER = net.simplico.tmtlive;
404
 				PRODUCT_BUNDLE_IDENTIFIER = net.simplico.tmtlive;
377
 				PRODUCT_NAME = "$(TARGET_NAME)";
405
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 8 - 0
ios/App/App/App.entitlements

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>aps-environment</key>
6
+	<string>development</string>
7
+</dict>
8
+</plist>

+ 18 - 1
ios/App/App/AppDelegate.swift

1
 import UIKit
1
 import UIKit
2
 import Capacitor
2
 import Capacitor
3
 import FBSDKCoreKit
3
 import FBSDKCoreKit
4
-
4
+import Firebase
5
 
5
 
6
 @UIApplicationMain
6
 @UIApplicationMain
7
 class AppDelegate: UIResponder, UIApplicationDelegate {
7
 class AppDelegate: UIResponder, UIApplicationDelegate {
11
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
11
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
12
         // Override point for customization after application launch.
12
         // Override point for customization after application launch.
13
         FBSDKCoreKit.ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
13
         FBSDKCoreKit.ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
14
+        FirebaseApp.configure()
14
         return true
15
         return true
15
     }
16
     }
16
 
17
 
59
         // tracking app url opens, make sure to keep this call
60
         // tracking app url opens, make sure to keep this call
60
         return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
61
         return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
61
     }
62
     }
63
+    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
64
+      NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken)
65
+        Messaging.messaging().apnsToken = deviceToken
66
+        Messaging.messaging().token(completion: { (token, error) in
67
+             if let error = error {
68
+                 NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
69
+             } else if let token = token {
70
+                 NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: token)
71
+             }
72
+        })
73
+    }
74
+
75
+    func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
76
+      NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
77
+    
78
+    }
62
 
79
 
63
 }
80
 }

+ 38 - 0
ios/App/App/GoogleService-Info.plist

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>CLIENT_ID</key>
6
+	<string>496323526366-khm7rkn7rthnauaailuth9sdid4of8d8.apps.googleusercontent.com</string>
7
+	<key>REVERSED_CLIENT_ID</key>
8
+	<string>com.googleusercontent.apps.496323526366-khm7rkn7rthnauaailuth9sdid4of8d8</string>
9
+	<key>PLIST_VERSION</key>
10
+	<string>1</string>
11
+	<key>BUNDLE_ID</key>
12
+	<string>net.simplico.tmtlive</string>
13
+    <key>API_KEY</key>
14
+    <string>AIzaSyCEy_bLCJITwxRi-5vsiyArQM5oow5NAgk</string>
15
+    <key>GCM_SENDER_ID</key>
16
+    <string>214019008700</string>
17
+    <key>PLIST_VERSION</key>
18
+    <string>1</string>
19
+    <key>BUNDLE_ID</key>
20
+    <string>net.simplico.tmtlive</string>
21
+    <key>PROJECT_ID</key>
22
+    <string>tmtlive-557ac</string>
23
+    <key>STORAGE_BUCKET</key>
24
+    <string>tmtlive-557ac.appspot.com</string>
25
+    <key>IS_ADS_ENABLED</key>
26
+    <false></false>
27
+    <key>IS_ANALYTICS_ENABLED</key>
28
+    <false></false>
29
+    <key>IS_APPINVITE_ENABLED</key>
30
+    <true></true>
31
+    <key>IS_GCM_ENABLED</key>
32
+    <true></true>
33
+    <key>IS_SIGNIN_ENABLED</key>
34
+    <true></true>
35
+    <key>GOOGLE_APP_ID</key>
36
+    <string>1:214019008700:ios:be7fb5f07aeed695c088b9</string>
37
+</dict>
38
+</plist>

+ 42 - 33
ios/App/App/Info.plist

45
 	</array>
45
 	</array>
46
 	<key>UIViewControllerBasedStatusBarAppearance</key>
46
 	<key>UIViewControllerBasedStatusBarAppearance</key>
47
 	<true/>
47
 	<true/>
48
-    <key>CFBundleURLTypes</key>
49
-        <array>
50
-        <dict>
51
-            <key>CFBundleURLSchemes</key>
52
-            <array>
53
-            <string>fb200395709360570</string>
54
-            </array>
55
-        </dict>
56
-        </array>
57
-        <key>FacebookAppID</key>
58
-        <string>200395709360570</string>
59
-        <key>FacebookClientToken</key>
60
-        <string>a3ae16e80d605bab9483feaa4c523e84</string>
61
-        <key>FacebookDisplayName</key>
62
-        <string>tigermuaythai.live</string>
63
-        <key>LSApplicationQueriesSchemes</key>
64
-        <array>
65
-            <string>fbapi</string>
66
-            <string>fbapi20130214</string>
67
-            <string>fbapi20130410</string>
68
-            <string>fbapi20130702</string>
69
-            <string>fbapi20131010</string>
70
-            <string>fbapi20131219</string>
71
-            <string>fbapi20140410</string>
72
-            <string>fbapi20140116</string>
73
-            <string>fbapi20150313</string>
74
-            <string>fbapi20150629</string>
75
-            <string>fbapi20160328</string>
76
-            <string>fbauth</string>
77
-            <string>fb-messenger-share-api</string>
78
-            <string>fbauth2</string>
79
-            <string>fbshareextension</string>
80
-        </array>
48
+  <key>CFBundleURLTypes</key>
49
+  <array>
50
+    <dict>
51
+      <key>CFBundleURLSchemes</key>
52
+      <array>
53
+        <string>fb200395709360570</string>
54
+      </array>
55
+    </dict>
56
+    <dict>
57
+			<key>CFBundleURLName</key>
58
+			<string>net.simplico.tmtlive</string>
59
+			<key>CFBundleURLSchemes</key>
60
+			<array>
61
+				<string>tmtlive</string>
62
+				<string>com.googleusercontent.apps.496323526366-khm7rkn7rthnauaailuth9sdid4of8d8</string>
63
+			</array>
64
+		</dict>
65
+  </array>
66
+  <key>FacebookAppID</key>
67
+  <string>200395709360570</string>
68
+  <key>FacebookClientToken</key>
69
+  <string>a3ae16e80d605bab9483feaa4c523e84</string>
70
+  <key>FacebookDisplayName</key>
71
+  <string>tigermuaythai.live</string>
72
+  <key>LSApplicationQueriesSchemes</key>
73
+  <array>
74
+    <string>fbapi</string>
75
+    <string>fbapi20130214</string>
76
+    <string>fbapi20130410</string>
77
+    <string>fbapi20130702</string>
78
+    <string>fbapi20131010</string>
79
+    <string>fbapi20131219</string>
80
+    <string>fbapi20140410</string>
81
+    <string>fbapi20140116</string>
82
+    <string>fbapi20150313</string>
83
+    <string>fbapi20150629</string>
84
+    <string>fbapi20160328</string>
85
+    <string>fbauth</string>
86
+    <string>fb-messenger-share-api</string>
87
+    <string>fbauth2</string>
88
+    <string>fbshareextension</string>
89
+  </array>
81
 </dict>
90
 </dict>
82
 </plist>
91
 </plist>

File diff suppressed because it is too large
+ 13 - 0
ios/App/App/google-services.json


+ 3 - 0
ios/App/Podfile

16
   pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
16
   pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
17
   pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
17
   pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
18
   pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
18
   pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
19
+  pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
19
   pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
20
   pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
21
+  pod 'CodetrixStudioCapacitorGoogleAuth', :path => '../../node_modules/@codetrix-studio/capacitor-google-auth'
20
 end
22
 end
21
 
23
 
22
 target 'App' do
24
 target 'App' do
23
   capacitor_pods
25
   capacitor_pods
24
   # Add your Pods here
26
   # Add your Pods here
27
+  pod 'Firebase/Messaging' # Add this line
25
 end
28
 end
26
 
29
 
27
 post_install do |installer|
30
 post_install do |installer|

+ 107 - 1
ios/App/Podfile.lock

1
 PODS:
1
 PODS:
2
+  - AppAuth (1.6.2):
3
+    - AppAuth/Core (= 1.6.2)
4
+    - AppAuth/ExternalUserAgent (= 1.6.2)
5
+  - AppAuth/Core (1.6.2)
6
+  - AppAuth/ExternalUserAgent (1.6.2):
7
+    - AppAuth/Core
2
   - Capacitor (5.5.0):
8
   - Capacitor (5.5.0):
3
     - CapacitorCordova
9
     - CapacitorCordova
4
   - CapacitorApp (5.0.6):
10
   - CapacitorApp (5.0.6):
14
     - Capacitor
20
     - Capacitor
15
   - CapacitorPreferences (5.0.6):
21
   - CapacitorPreferences (5.0.6):
16
     - Capacitor
22
     - Capacitor
23
+  - CapacitorPushNotifications (5.1.0):
24
+    - Capacitor
17
   - CapacitorStatusBar (5.0.6):
25
   - CapacitorStatusBar (5.0.6):
18
     - Capacitor
26
     - Capacitor
27
+  - CodetrixStudioCapacitorGoogleAuth (0.0.1):
28
+    - Capacitor
29
+    - GoogleSignIn (~> 6.2.4)
19
   - FBAEMKit (16.1.3):
30
   - FBAEMKit (16.1.3):
20
     - FBSDKCoreKit_Basics (= 16.1.3)
31
     - FBSDKCoreKit_Basics (= 16.1.3)
21
   - FBSDKCoreKit (16.1.3):
32
   - FBSDKCoreKit (16.1.3):
24
   - FBSDKCoreKit_Basics (16.1.3)
35
   - FBSDKCoreKit_Basics (16.1.3)
25
   - FBSDKLoginKit (16.1.3):
36
   - FBSDKLoginKit (16.1.3):
26
     - FBSDKCoreKit (= 16.1.3)
37
     - FBSDKCoreKit (= 16.1.3)
38
+  - Firebase/CoreOnly (10.17.0):
39
+    - FirebaseCore (= 10.17.0)
40
+  - Firebase/Messaging (10.17.0):
41
+    - Firebase/CoreOnly
42
+    - FirebaseMessaging (~> 10.17.0)
43
+  - FirebaseCore (10.17.0):
44
+    - FirebaseCoreInternal (~> 10.0)
45
+    - GoogleUtilities/Environment (~> 7.8)
46
+    - GoogleUtilities/Logger (~> 7.8)
47
+  - FirebaseCoreInternal (10.17.0):
48
+    - "GoogleUtilities/NSData+zlib (~> 7.8)"
49
+  - FirebaseInstallations (10.17.0):
50
+    - FirebaseCore (~> 10.0)
51
+    - GoogleUtilities/Environment (~> 7.8)
52
+    - GoogleUtilities/UserDefaults (~> 7.8)
53
+    - PromisesObjC (~> 2.1)
54
+  - FirebaseMessaging (10.17.0):
55
+    - FirebaseCore (~> 10.0)
56
+    - FirebaseInstallations (~> 10.0)
57
+    - GoogleDataTransport (~> 9.2)
58
+    - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
59
+    - GoogleUtilities/Environment (~> 7.8)
60
+    - GoogleUtilities/Reachability (~> 7.8)
61
+    - GoogleUtilities/UserDefaults (~> 7.8)
62
+    - nanopb (< 2.30910.0, >= 2.30908.0)
63
+  - GoogleDataTransport (9.2.5):
64
+    - GoogleUtilities/Environment (~> 7.7)
65
+    - nanopb (< 2.30910.0, >= 2.30908.0)
66
+    - PromisesObjC (< 3.0, >= 1.2)
67
+  - GoogleSignIn (6.2.4):
68
+    - AppAuth (~> 1.5)
69
+    - GTMAppAuth (~> 1.3)
70
+    - GTMSessionFetcher/Core (< 3.0, >= 1.1)
71
+  - GoogleUtilities/AppDelegateSwizzler (7.11.6):
72
+    - GoogleUtilities/Environment
73
+    - GoogleUtilities/Logger
74
+    - GoogleUtilities/Network
75
+  - GoogleUtilities/Environment (7.11.6):
76
+    - PromisesObjC (< 3.0, >= 1.2)
77
+  - GoogleUtilities/Logger (7.11.6):
78
+    - GoogleUtilities/Environment
79
+  - GoogleUtilities/Network (7.11.6):
80
+    - GoogleUtilities/Logger
81
+    - "GoogleUtilities/NSData+zlib"
82
+    - GoogleUtilities/Reachability
83
+  - "GoogleUtilities/NSData+zlib (7.11.6)"
84
+  - GoogleUtilities/Reachability (7.11.6):
85
+    - GoogleUtilities/Logger
86
+  - GoogleUtilities/UserDefaults (7.11.6):
87
+    - GoogleUtilities/Logger
88
+  - GTMAppAuth (1.3.1):
89
+    - AppAuth/Core (~> 1.6)
90
+    - GTMSessionFetcher/Core (< 3.0, >= 1.5)
91
+  - GTMSessionFetcher/Core (2.3.0)
92
+  - nanopb (2.30909.1):
93
+    - nanopb/decode (= 2.30909.1)
94
+    - nanopb/encode (= 2.30909.1)
95
+  - nanopb/decode (2.30909.1)
96
+  - nanopb/encode (2.30909.1)
97
+  - PromisesObjC (2.3.1)
27
 
98
 
28
 DEPENDENCIES:
99
 DEPENDENCIES:
29
   - "Capacitor (from `../../node_modules/@capacitor/ios`)"
100
   - "Capacitor (from `../../node_modules/@capacitor/ios`)"
33
   - "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
104
   - "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
34
   - "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
105
   - "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
35
   - "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
106
   - "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
107
+  - "CapacitorPushNotifications (from `../../node_modules/@capacitor/push-notifications`)"
36
   - "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
108
   - "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
109
+  - "CodetrixStudioCapacitorGoogleAuth (from `../../node_modules/@codetrix-studio/capacitor-google-auth`)"
110
+  - Firebase/Messaging
37
 
111
 
38
 SPEC REPOS:
112
 SPEC REPOS:
39
   trunk:
113
   trunk:
114
+    - AppAuth
40
     - FBAEMKit
115
     - FBAEMKit
41
     - FBSDKCoreKit
116
     - FBSDKCoreKit
42
     - FBSDKCoreKit_Basics
117
     - FBSDKCoreKit_Basics
43
     - FBSDKLoginKit
118
     - FBSDKLoginKit
119
+    - Firebase
120
+    - FirebaseCore
121
+    - FirebaseCoreInternal
122
+    - FirebaseInstallations
123
+    - FirebaseMessaging
124
+    - GoogleDataTransport
125
+    - GoogleSignIn
126
+    - GoogleUtilities
127
+    - GTMAppAuth
128
+    - GTMSessionFetcher
129
+    - nanopb
130
+    - PromisesObjC
44
 
131
 
45
 EXTERNAL SOURCES:
132
 EXTERNAL SOURCES:
46
   Capacitor:
133
   Capacitor:
57
     :path: "../../node_modules/@capacitor/keyboard"
144
     :path: "../../node_modules/@capacitor/keyboard"
58
   CapacitorPreferences:
145
   CapacitorPreferences:
59
     :path: "../../node_modules/@capacitor/preferences"
146
     :path: "../../node_modules/@capacitor/preferences"
147
+  CapacitorPushNotifications:
148
+    :path: "../../node_modules/@capacitor/push-notifications"
60
   CapacitorStatusBar:
149
   CapacitorStatusBar:
61
     :path: "../../node_modules/@capacitor/status-bar"
150
     :path: "../../node_modules/@capacitor/status-bar"
151
+  CodetrixStudioCapacitorGoogleAuth:
152
+    :path: "../../node_modules/@codetrix-studio/capacitor-google-auth"
62
 
153
 
63
 SPEC CHECKSUMS:
154
 SPEC CHECKSUMS:
155
+  AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
64
   Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a
156
   Capacitor: 57890b363df14d5d2d5d8461aa23e886cb34da2a
65
   CapacitorApp: 024e1b1bea5f883d79f6330d309bc441c88ad04a
157
   CapacitorApp: 024e1b1bea5f883d79f6330d309bc441c88ad04a
66
   CapacitorCommunityFacebookLogin: c0e2bb54cb567d90443a80ae20569fdac0df3f89
158
   CapacitorCommunityFacebookLogin: c0e2bb54cb567d90443a80ae20569fdac0df3f89
68
   CapacitorHaptics: 1fffc1217c7e64a472d7845be50fb0c2f7d4204c
160
   CapacitorHaptics: 1fffc1217c7e64a472d7845be50fb0c2f7d4204c
69
   CapacitorKeyboard: b978154b024a5f65e044908e37d15b7de58b9d12
161
   CapacitorKeyboard: b978154b024a5f65e044908e37d15b7de58b9d12
70
   CapacitorPreferences: f03954bcb0ff09c792909e46bff88e3183c16b10
162
   CapacitorPreferences: f03954bcb0ff09c792909e46bff88e3183c16b10
163
+  CapacitorPushNotifications: b31e326c6e4eb216a622041d6ca21a973f34943f
71
   CapacitorStatusBar: 565c0a1ebd79bb40d797606a8992b4a105885309
164
   CapacitorStatusBar: 565c0a1ebd79bb40d797606a8992b4a105885309
165
+  CodetrixStudioCapacitorGoogleAuth: fcce058390347c1ce5d8ac4764bdf1f5c1ee233b
72
   FBAEMKit: af2972f39bb0f3f7c45998f435b007833c32ffb2
166
   FBAEMKit: af2972f39bb0f3f7c45998f435b007833c32ffb2
73
   FBSDKCoreKit: 19e2e18b3be578d7a51fed8fdd8c152bef0b9511
167
   FBSDKCoreKit: 19e2e18b3be578d7a51fed8fdd8c152bef0b9511
74
   FBSDKCoreKit_Basics: dd9826ce3c9fd9f8cdf8dbbd0ef0a53e6c0c9e7e
168
   FBSDKCoreKit_Basics: dd9826ce3c9fd9f8cdf8dbbd0ef0a53e6c0c9e7e
75
   FBSDKLoginKit: c395c63a1a6cf4a8a1e6103fd94b8c46329ee81c
169
   FBSDKLoginKit: c395c63a1a6cf4a8a1e6103fd94b8c46329ee81c
170
+  Firebase: f4ac0b02927af9253ae094d23deecf0890da7374
171
+  FirebaseCore: 534544dd98cabcf4bf8598d88ec683b02319a528
172
+  FirebaseCoreInternal: 2cf9202e226e3f78d2bf6d56c472686b935bfb7f
173
+  FirebaseInstallations: 9387bf15abfc69a714f54e54f74a251264fdb79b
174
+  FirebaseMessaging: 1367b28c0c83a63072af4a711328fcc2e6899902
175
+  GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
176
+  GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a
177
+  GoogleUtilities: 202e7a9f5128accd11160fb9c19612de1911aa19
178
+  GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
179
+  GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
180
+  nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
181
+  PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
76
 
182
 
77
-PODFILE CHECKSUM: c9736b063f76e0be20a97ef4e5e07cd2323fa896
183
+PODFILE CHECKSUM: 13a486d397817692d7e7744cf0c6e77b81469655
78
 
184
 
79
 COCOAPODS: 1.12.1
185
 COCOAPODS: 1.12.1

+ 18 - 0
package-lock.json

15
         "@capacitor/ios": "5.5.0",
15
         "@capacitor/ios": "5.5.0",
16
         "@capacitor/keyboard": "5.0.6",
16
         "@capacitor/keyboard": "5.0.6",
17
         "@capacitor/preferences": "^5.0.6",
17
         "@capacitor/preferences": "^5.0.6",
18
+        "@capacitor/push-notifications": "^5.1.0",
18
         "@capacitor/status-bar": "5.0.6",
19
         "@capacitor/status-bar": "5.0.6",
20
+        "@codetrix-studio/capacitor-google-auth": "^3.3.4",
19
         "@ionic/vue": "^7.0.0",
21
         "@ionic/vue": "^7.0.0",
20
         "@ionic/vue-router": "^7.0.0",
22
         "@ionic/vue-router": "^7.0.0",
21
         "@vimeo/player": "^2.20.1",
23
         "@vimeo/player": "^2.20.1",
1908
         "@capacitor/core": "^5.0.0"
1910
         "@capacitor/core": "^5.0.0"
1909
       }
1911
       }
1910
     },
1912
     },
1913
+    "node_modules/@capacitor/push-notifications": {
1914
+      "version": "5.1.0",
1915
+      "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-5.1.0.tgz",
1916
+      "integrity": "sha512-Laxi5TQbwTqQFNJZdyyfJJqb+OVZz+0VRtW4uhM+u5TKWuXCYw/yrctXuIpG+VFUptvtPG7ic7+0WcBs+sQ17Q==",
1917
+      "peerDependencies": {
1918
+        "@capacitor/core": "^5.0.0"
1919
+      }
1920
+    },
1911
     "node_modules/@capacitor/status-bar": {
1921
     "node_modules/@capacitor/status-bar": {
1912
       "version": "5.0.6",
1922
       "version": "5.0.6",
1913
       "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-5.0.6.tgz",
1923
       "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-5.0.6.tgz",
1916
         "@capacitor/core": "^5.0.0"
1926
         "@capacitor/core": "^5.0.0"
1917
       }
1927
       }
1918
     },
1928
     },
1929
+    "node_modules/@codetrix-studio/capacitor-google-auth": {
1930
+      "version": "3.3.4",
1931
+      "resolved": "https://registry.npmjs.org/@codetrix-studio/capacitor-google-auth/-/capacitor-google-auth-3.3.4.tgz",
1932
+      "integrity": "sha512-R9kTWK5x2bT+gXV1ia48Xt/rS1RPXrVVPDCeX4mpGFyIyjdx1FmuAkHeFNsSQ4sGDKkjCWnXf6z+ikcKnusz7g==",
1933
+      "peerDependencies": {
1934
+        "@capacitor/core": "^5.0.0"
1935
+      }
1936
+    },
1919
     "node_modules/@colors/colors": {
1937
     "node_modules/@colors/colors": {
1920
       "version": "1.5.0",
1938
       "version": "1.5.0",
1921
       "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",
1939
       "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz",

+ 2 - 0
package.json

19
     "@capacitor/ios": "5.5.0",
19
     "@capacitor/ios": "5.5.0",
20
     "@capacitor/keyboard": "5.0.6",
20
     "@capacitor/keyboard": "5.0.6",
21
     "@capacitor/preferences": "^5.0.6",
21
     "@capacitor/preferences": "^5.0.6",
22
+    "@capacitor/push-notifications": "^5.1.0",
22
     "@capacitor/status-bar": "5.0.6",
23
     "@capacitor/status-bar": "5.0.6",
24
+    "@codetrix-studio/capacitor-google-auth": "^3.3.4",
23
     "@ionic/vue": "^7.0.0",
25
     "@ionic/vue": "^7.0.0",
24
     "@ionic/vue-router": "^7.0.0",
26
     "@ionic/vue-router": "^7.0.0",
25
     "@vimeo/player": "^2.20.1",
27
     "@vimeo/player": "^2.20.1",

+ 9 - 1
src/App.vue

5
 </template>
5
 </template>
6
 
6
 
7
 <script setup lang="ts">
7
 <script setup lang="ts">
8
-import { IonApp, IonRouterOutlet } from '@ionic/vue';
8
+import { IonApp, IonRouterOutlet, onIonViewWillEnter } from '@ionic/vue';
9
+import { defineComponent, onMounted } from 'vue';
10
+
11
+
12
+
13
+onIonViewWillEnter(() => {
14
+  console.log("Init On Mouting")
15
+});
16
+
9
 </script>
17
 </script>

+ 14 - 0
src/settings.ts

63
   console.log(data)
63
   console.log(data)
64
   return data.results
64
   return data.results
65
 }
65
 }
66
+
67
+export const storeAPNToken = async (device_token) => {
68
+  
69
+  const token = await Preferences.get({ key: 'token' });
70
+  console.log("token = ", token)
71
+  const { data } = await axios.post(BASE_URL + "backend/api/device_tokens/",{token: device_token},
72
+  {
73
+    headers: { 
74
+    'Authorization': `Token ${token.value}`
75
+    }
76
+  })
77
+  console.log(data)
78
+  return data
79
+}

+ 36 - 2
src/views/ProfilePage.vue

7
     </ion-header>
7
     </ion-header>
8
     <ion-content>
8
     <ion-content>
9
       <div class="example-content">Listen now content</div>
9
       <div class="example-content">Listen now content</div>
10
-      <ion-button @click='fbLogout' v-if='isLogin'>Facebook Logout</ion-button>
11
-      <ion-button @click='fbLogin' v-else>Facebook Login</ion-button>
10
+      <template v-if="isLogin">
11
+      <ion-button @click='fbLogout'>Logout</ion-button>
12
+      </template>
13
+      <template v-else>
14
+        <ion-button @click='fbLogin'>Facebook Login</ion-button>
15
+        <ion-button @click='ggLogin'>Google Login</ion-button>
16
+      </template>
12
     </ion-content>
17
     </ion-content>
13
   </ion-page>
18
   </ion-page>
14
 </template>
19
 </template>
16
 <script setup lang="ts">
21
 <script setup lang="ts">
17
 import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton, onIonViewWillEnter } from '@ionic/vue';
22
 import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton, onIonViewWillEnter } from '@ionic/vue';
18
 import ExploreContainer from '@/components/ExploreContainer.vue';
23
 import ExploreContainer from '@/components/ExploreContainer.vue';
24
+import { defineComponent, onMounted } from 'vue';
25
+import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
26
+
27
+onMounted(() => {
28
+  GoogleAuth.initialize();
29
+});
19
 
30
 
20
 import {
31
 import {
21
   FacebookLogin,
32
   FacebookLogin,
33
 
44
 
34
 const isLogin = ref(false)
45
 const isLogin = ref(false)
35
 
46
 
47
+const ggLogin = async () => {
48
+  const response = await GoogleAuth.signIn();
49
+  console.log(response);
50
+  console.log(response.accessToken)
51
+  if( response.authentication.accessToken ) {
52
+    isLogin.value = true
53
+  }
54
+}
55
+
36
 const fbLogin = async () => {
56
 const fbLogin = async () => {
37
   const result = await (<FacebookLoginResponse>(
57
   const result = await (<FacebookLoginResponse>(
38
     FacebookLogin.login({ permissions: FACEBOOK_PERMISSIONS })
58
     FacebookLogin.login({ permissions: FACEBOOK_PERMISSIONS })
60
   }else {
80
   }else {
61
     isLogin.value = false
81
     isLogin.value = false
62
   }
82
   }
83
+  ggCheckLogin()
63
 
84
 
64
 })
85
 })
65
 const getProfile = async () => {
86
 const getProfile = async () => {
69
 
90
 
70
   console.log(`Facebook user's email is ${result.email}`);
91
   console.log(`Facebook user's email is ${result.email}`);
71
 }
92
 }
93
+const ggCheckLogin = async() => {
94
+    GoogleAuth.refresh()
95
+        .then((data) => {
96
+            if (data.accessToken) {
97
+                isLogin.value = true
98
+            }
99
+        })
100
+        .catch((error) => {
101
+            if (error.type === 'userLoggedOut') {
102
+                //this.signin()
103
+            }
104
+        });
105
+}
72
 </script>
106
 </script>

+ 44 - 1
src/views/Tab1Page.vue

79
 import ExploreContainer  from '@/components/ExploreContainer.vue';
79
 import ExploreContainer  from '@/components/ExploreContainer.vue';
80
 import { CapacitorHttp } from '@capacitor/core';
80
 import { CapacitorHttp } from '@capacitor/core';
81
 import { ref } from 'vue';
81
 import { ref } from 'vue';
82
-import { TOKEN, getProducts, setToken, getObject, getToken, getTrainers, listMats } from '@/settings';
82
+import { TOKEN, getProducts, setToken, getObject, getToken, getTrainers, listMats, storeAPNToken } from '@/settings';
83
 //import VueCoreVideoPlayer from 'vue-core-video-player'
83
 //import VueCoreVideoPlayer from 'vue-core-video-player'
84
 import { vueVimeoPlayer } from 'vue-vimeo-player'
84
 import { vueVimeoPlayer } from 'vue-vimeo-player'
85
 
85
 
86
+import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
87
+
88
+import { PushNotifications } from '@capacitor/push-notifications';
86
 
89
 
87
 import Player from '@vimeo/player';
90
 import Player from '@vimeo/player';
88
 
91
 
127
     mats.value = await listMats()
130
     mats.value = await listMats()
128
     console.log(" trainers => ", trainers)
131
     console.log(" trainers => ", trainers)
129
 
132
 
133
+    GoogleAuth.initialize();
134
+    registerNotifications()
135
+    addListeners()
130
   })
136
   })
131
 
137
 
132
   onIonViewWillLeave(() => {
138
   onIonViewWillLeave(() => {
145
     const response: HttpResponse = await CapacitorHttp.get(options);
151
     const response: HttpResponse = await CapacitorHttp.get(options);
146
     console.log(response)
152
     console.log(response)
147
   }
153
   }
154
+const addListeners = async () => {
155
+  await PushNotifications.addListener('registration', token => {
156
+    console.info('Registration token: ', token.value);
157
+    storeAPNToken(token.value)
158
+  });
159
+
160
+  await PushNotifications.addListener('registrationError', err => {
161
+    console.error('Registration error: ', err.error);
162
+  });
163
+
164
+  await PushNotifications.addListener('pushNotificationReceived', notification => {
165
+    console.log('Push notification received: ', notification);
166
+  });
167
+
168
+  await PushNotifications.addListener('pushNotificationActionPerformed', notification => {
169
+    console.log('Push notification action performed', notification.actionId, notification.inputValue);
170
+  });
171
+}
172
+
173
+const registerNotifications = async () => {
174
+  let permStatus = await PushNotifications.checkPermissions();
175
+
176
+  if (permStatus.receive === 'prompt') {
177
+    permStatus = await PushNotifications.requestPermissions();
178
+  }
179
+
180
+  if (permStatus.receive !== 'granted') {
181
+    throw new Error('User denied permissions!');
182
+  }
183
+
184
+  await PushNotifications.register();
185
+}
186
+
187
+const getDeliveredNotifications = async () => {
188
+  const notificationList = await PushNotifications.getDeliveredNotifications();
189
+  console.log('delivered notifications', notificationList);
190
+}
148
 </script>
191
 </script>

tmt/tiger_frontend - Gogs: Simplico Git Service

Nav apraksta

inherits_browser.js 753B

12345678910111213141516171819202122232425262728
  1. if (typeof Object.create === 'function') {
  2. // implementation from standard node.js 'util' module
  3. module.exports = function inherits(ctor, superCtor) {
  4. if (superCtor) {
  5. ctor.super_ = superCtor
  6. ctor.prototype = Object.create(superCtor.prototype, {
  7. constructor: {
  8. value: ctor,
  9. enumerable: false,
  10. writable: true,
  11. configurable: true
  12. }
  13. })
  14. }
  15. };
  16. } else {
  17. // old school shim for old browsers
  18. module.exports = function inherits(ctor, superCtor) {
  19. if (superCtor) {
  20. ctor.super_ = superCtor
  21. var TempCtor = function () {}
  22. TempCtor.prototype = superCtor.prototype
  23. ctor.prototype = new TempCtor()
  24. ctor.prototype.constructor = ctor
  25. }
  26. }
  27. }