Commit 416a5204 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

ios changes

parent 85e1b258
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>API_KEY</key> <key>API_KEY</key>
<string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string> <string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string>
<key>GCM_SENDER_ID</key> <key>GCM_SENDER_ID</key>
<string>207322820833</string> <string>207322820833</string>
<key>PLIST_VERSION</key> <key>PLIST_VERSION</key>
<string>1</string> <string>1</string>
<key>BUNDLE_ID</key> <key>BUNDLE_ID</key>
<string>in.webgrid.pulse</string> <string>in.webgrid.pulse</string>
<key>PROJECT_ID</key> <key>PROJECT_ID</key>
<string>pulse-5cf9a</string> <string>pulse-5cf9a</string>
<key>STORAGE_BUCKET</key> <key>STORAGE_BUCKET</key>
<string>pulse-5cf9a.firebasestorage.app</string> <string>pulse-5cf9a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key> <key>IS_ADS_ENABLED</key>
<false></false> <false></false>
<key>IS_ANALYTICS_ENABLED</key> <key>IS_ANALYTICS_ENABLED</key>
<false></false> <false></false>
<key>IS_APPINVITE_ENABLED</key> <key>IS_APPINVITE_ENABLED</key>
<true></true> <true></true>
<key>IS_GCM_ENABLED</key> <key>IS_GCM_ENABLED</key>
<true></true> <true></true>
<key>IS_SIGNIN_ENABLED</key> <key>IS_SIGNIN_ENABLED</key>
<true></true> <true></true>
<key>GOOGLE_APP_ID</key> <key>GOOGLE_APP_ID</key>
<string>1:207322820833:ios:1c45799abca19c064447a0</string> <string>1:207322820833:ios:1c45799abca19c064447a0</string>
</dict> </dict>
</plist> </plist>
\ No newline at end of file
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9A05BB8B2E9CD1D700333E47 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; }; 9A05BB8B2E9CD1D700333E47 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
9AA6F52E2E9D26F200A0986D /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
AF659704885D6C95DAEFD002 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; }; AF659704885D6C95DAEFD002 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
B1AFB0BB8DE07C1D6AFFEEAF /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B1AFB0BB8DE07C1D6AFFEEAF /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C7D415B917FF23E2D93066EB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; C7D415B917FF23E2D93066EB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
...@@ -155,6 +156,7 @@ ...@@ -155,6 +156,7 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9AA6F52E2E9D26F200A0986D /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
...@@ -491,9 +493,12 @@ ...@@ -491,9 +493,12 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 72BV93K9AR; DEVELOPMENT_TEAM = 72BV93K9AR;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
FLUTTER_BUILD_NUMBER = 2;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -674,9 +679,12 @@ ...@@ -674,9 +679,12 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 72BV93K9AR; DEVELOPMENT_TEAM = 72BV93K9AR;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
FLUTTER_BUILD_NUMBER = 2;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
...@@ -697,9 +705,12 @@ ...@@ -697,9 +705,12 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 72BV93K9AR; DEVELOPMENT_TEAM = 72BV93K9AR;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
FLUTTER_BUILD_NUMBER = 2;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
......
...@@ -9,7 +9,7 @@ import FirebaseCore ...@@ -9,7 +9,7 @@ import FirebaseCore
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
FirebaseApp.configure() // FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
......
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>API_KEY</key> <key>API_KEY</key>
<string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string> <string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string>
<key>GCM_SENDER_ID</key> <key>GCM_SENDER_ID</key>
<string>207322820833</string> <string>207322820833</string>
<key>PLIST_VERSION</key> <key>PLIST_VERSION</key>
<string>1</string> <string>1</string>
<key>BUNDLE_ID</key> <key>BUNDLE_ID</key>
<string>in.webgrid.pulse</string> <string>in.webgrid.pulse</string>
<key>PROJECT_ID</key> <key>PROJECT_ID</key>
<string>pulse-5cf9a</string> <string>pulse-5cf9a</string>
<key>STORAGE_BUCKET</key> <key>STORAGE_BUCKET</key>
<string>pulse-5cf9a.firebasestorage.app</string> <string>pulse-5cf9a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key> <key>IS_ADS_ENABLED</key>
<false></false> <false></false>
<key>IS_ANALYTICS_ENABLED</key> <key>IS_ANALYTICS_ENABLED</key>
<false></false> <false></false>
<key>IS_APPINVITE_ENABLED</key> <key>IS_APPINVITE_ENABLED</key>
<true></true> <true></true>
<key>IS_GCM_ENABLED</key> <key>IS_GCM_ENABLED</key>
<true></true> <true></true>
<key>IS_SIGNIN_ENABLED</key> <key>IS_SIGNIN_ENABLED</key>
<true></true> <true></true>
<key>GOOGLE_APP_ID</key> <key>GOOGLE_APP_ID</key>
<string>1:207322820833:ios:1c45799abca19c064447a0</string> <string>1:207322820833:ios:1c45799abca19c064447a0</string>
</dict> </dict>
</plist> </plist>
\ No newline at end of file
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true/> <true/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
<string>fetch</string>
</array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
...@@ -46,7 +46,7 @@ class ProfileProvider extends ChangeNotifier { ...@@ -46,7 +46,7 @@ class ProfileProvider extends ChangeNotifier {
if (Platform.isAndroid) { if (Platform.isAndroid) {
fcmToken = await FirebaseMessaging.instance.getToken(); fcmToken = await FirebaseMessaging.instance.getToken();
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
fcmToken = await FirebaseMessaging.instance.getAPNSToken(); fcmToken = await FirebaseMessaging.instance.getToken();
} }
final data = await ApiService.fetchProfile( final data = await ApiService.fetchProfile(
csrfToken: csrfToken, csrfToken: csrfToken,
......
...@@ -47,7 +47,7 @@ class DefaultFirebaseOptions { ...@@ -47,7 +47,7 @@ class DefaultFirebaseOptions {
appId: '1:207322820833:ios:1c45799abca19c064447a0', appId: '1:207322820833:ios:1c45799abca19c064447a0',
messagingSenderId: '207322820833', messagingSenderId: '207322820833',
projectId: 'pulse-5cf9a', projectId: 'pulse-5cf9a',
storageBucket: 'pulse-5cf9a.firebasestorage.com', storageBucket: 'pulse-5cf9a.firebasestorage.app',
iosBundleId: 'in.webgrid.pulse', iosBundleId: 'in.webgrid.pulse',
); );
} }
...@@ -19,7 +19,6 @@ import 'package:pulse/firebase_options.dart'; ...@@ -19,7 +19,6 @@ import 'package:pulse/firebase_options.dart';
import 'package:pulse/utils/SharedpreferencesService.dart'; import 'package:pulse/utils/SharedpreferencesService.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'Screens/home_screen.dart'; import 'Screens/home_screen.dart';
// Needed to navigate outside BuildContext // Needed to navigate outside BuildContext
...@@ -87,19 +86,16 @@ Future<void> main() async { ...@@ -87,19 +86,16 @@ Future<void> main() async {
await messaging.requestPermission(alert: true, badge: true, sound: true); await messaging.requestPermission(alert: true, badge: true, sound: true);
if (Platform.isAndroid) { if (Platform.isAndroid) {
FirebaseMessaging.instance.getToken().then((value) { await FirebaseMessaging.instance.getToken().then((value) {
String? token = value; String? token = value;
// print("Androidfbstoken:{$token}"); // print("Androidfbstoken:{$token}");
SharedPreferencesService.instance.saveString("fbstoken", token!); SharedPreferencesService.instance.saveString("fbstoken", token!);
// toast(BuildContext , token); // toast(BuildContext , token);
}); });
} else { } else {
FirebaseMessaging.instance.getAPNSToken().then((value) { String? token = await FirebaseMessaging.instance.getToken();
String? token = value; print("IOSfbstoken:{$token}");
// print("IOSfbstoken:{$token}");
SharedPreferencesService.instance.saveString("fbstoken", token ?? ""); SharedPreferencesService.instance.saveString("fbstoken", token ?? "");
// toast(BuildContext , token);
});
} }
// print("🔥 FCM Token: $token"); // print("🔥 FCM Token: $token");
...@@ -162,7 +158,8 @@ class MyApp extends StatelessWidget { ...@@ -162,7 +158,8 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Web Grid Pulse', title: 'Web Grid Pulse',
navigatorKey: navigatorKey, navigatorKey: navigatorKey,
theme: themeProvider.isDark theme:
themeProvider.isDark
? ThemeData.dark() ? ThemeData.dark()
: ThemeData.light().copyWith( : ThemeData.light().copyWith(
scaffoldBackgroundColor: const Color(0xFFF5F8FC), scaffoldBackgroundColor: const Color(0xFFF5F8FC),
...@@ -183,24 +180,22 @@ class NotificationHandler { ...@@ -183,24 +180,22 @@ class NotificationHandler {
final prefs = SharedPreferencesService.instance; final prefs = SharedPreferencesService.instance;
final sessionId = await prefs.getString("sessionId"); final sessionId = await prefs.getString("sessionId");
final staffId = await prefs.getString("staffId"); final staffId = await prefs.getString("staffId");
debugPrint("✅ Direct session restore $sessionId"); // debugPrint("✅ Direct session restore $sessionId");
debugPrint("✅ Direct staff restore $staffId"); // debugPrint("✅ Direct staff restore $staffId");
debugPrint("🔗 Handling Notification:"); debugPrint("🔗 Handling Notification:");
debugPrint("type=$type, value=$value, id=$notifId"); debugPrint("type=$type, value=$value, id=$notifId");
// Decide what to do based on the type // Decide what to do based on the type
if (type == 'url' && value != null) { if (type == 'url' && value != null) {
navigatorKey.currentState?.push( navigatorKey.currentState?.push(
MaterialPageRoute( MaterialPageRoute(
builder:
builder: (_) => HomeScreen( (_) => HomeScreen(
sessionId: sessionId.toString(), sessionId: sessionId.toString(),
staffId: staffId.toString(), staffId: staffId.toString(),
notificationUrl: value, notificationUrl: value,
), ),
), ),
); );
} }
......
...@@ -11,12 +11,12 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -11,12 +11,12 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# build by specifying --build-name and --build-number, respectively. # build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode. # In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as `CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1 version: 1.0.1+2
environment: environment:
sdk: ^3.7.2 sdk: ^3.7.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment