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

ios changes

parent 85e1b258
......@@ -2,29 +2,29 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string>
<key>GCM_SENDER_ID</key>
<string>207322820833</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>in.webgrid.pulse</string>
<key>PROJECT_ID</key>
<string>pulse-5cf9a</string>
<key>STORAGE_BUCKET</key>
<string>pulse-5cf9a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:207322820833:ios:1c45799abca19c064447a0</string>
<key>API_KEY</key>
<string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string>
<key>GCM_SENDER_ID</key>
<string>207322820833</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>in.webgrid.pulse</string>
<key>PROJECT_ID</key>
<string>pulse-5cf9a</string>
<key>STORAGE_BUCKET</key>
<string>pulse-5cf9a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:207322820833:ios:1c45799abca19c064447a0</string>
</dict>
</plist>
\ No newline at end of file
......@@ -63,6 +63,7 @@
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>"; };
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>"; };
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>"; };
......@@ -155,6 +156,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
9AA6F52E2E9D26F200A0986D /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
......@@ -491,9 +493,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 72BV93K9AR;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
FLUTTER_BUILD_NUMBER = 2;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
......@@ -674,9 +679,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 72BV93K9AR;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
FLUTTER_BUILD_NUMBER = 2;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
......@@ -697,9 +705,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 72BV93K9AR;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_NAME = 1.0.1;
FLUTTER_BUILD_NUMBER = 2;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
......
......@@ -9,7 +9,7 @@ import FirebaseCore
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
// FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
......
......@@ -2,29 +2,29 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string>
<key>GCM_SENDER_ID</key>
<string>207322820833</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>in.webgrid.pulse</string>
<key>PROJECT_ID</key>
<string>pulse-5cf9a</string>
<key>STORAGE_BUCKET</key>
<string>pulse-5cf9a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:207322820833:ios:1c45799abca19c064447a0</string>
<key>API_KEY</key>
<string>AIzaSyC_KKF5G_fQNI2w4S8HP4d-DBJeybBlws8</string>
<key>GCM_SENDER_ID</key>
<string>207322820833</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>in.webgrid.pulse</string>
<key>PROJECT_ID</key>
<string>pulse-5cf9a</string>
<key>STORAGE_BUCKET</key>
<string>pulse-5cf9a.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:207322820833:ios:1c45799abca19c064447a0</string>
</dict>
</plist>
\ No newline at end of file
......@@ -28,6 +28,11 @@
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
<string>fetch</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<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 {
if (Platform.isAndroid) {
fcmToken = await FirebaseMessaging.instance.getToken();
} else if (Platform.isIOS) {
fcmToken = await FirebaseMessaging.instance.getAPNSToken();
fcmToken = await FirebaseMessaging.instance.getToken();
}
final data = await ApiService.fetchProfile(
csrfToken: csrfToken,
......
......@@ -47,7 +47,7 @@ class DefaultFirebaseOptions {
appId: '1:207322820833:ios:1c45799abca19c064447a0',
messagingSenderId: '207322820833',
projectId: 'pulse-5cf9a',
storageBucket: 'pulse-5cf9a.firebasestorage.com',
storageBucket: 'pulse-5cf9a.firebasestorage.app',
iosBundleId: 'in.webgrid.pulse',
);
}
......@@ -19,7 +19,6 @@ import 'package:pulse/firebase_options.dart';
import 'package:pulse/utils/SharedpreferencesService.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'Screens/home_screen.dart';
// Needed to navigate outside BuildContext
......@@ -87,19 +86,16 @@ Future<void> main() async {
await messaging.requestPermission(alert: true, badge: true, sound: true);
if (Platform.isAndroid) {
FirebaseMessaging.instance.getToken().then((value) {
await FirebaseMessaging.instance.getToken().then((value) {
String? token = value;
// print("Androidfbstoken:{$token}");
SharedPreferencesService.instance.saveString("fbstoken", token!);
// toast(BuildContext , token);
});
} else {
FirebaseMessaging.instance.getAPNSToken().then((value) {
String? token = value;
// print("IOSfbstoken:{$token}");
String? token = await FirebaseMessaging.instance.getToken();
print("IOSfbstoken:{$token}");
SharedPreferencesService.instance.saveString("fbstoken", token ?? "");
// toast(BuildContext , token);
});
}
// print("🔥 FCM Token: $token");
......@@ -162,7 +158,8 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: false,
title: 'Web Grid Pulse',
navigatorKey: navigatorKey,
theme: themeProvider.isDark
theme:
themeProvider.isDark
? ThemeData.dark()
: ThemeData.light().copyWith(
scaffoldBackgroundColor: const Color(0xFFF5F8FC),
......@@ -183,24 +180,22 @@ class NotificationHandler {
final prefs = SharedPreferencesService.instance;
final sessionId = await prefs.getString("sessionId");
final staffId = await prefs.getString("staffId");
debugPrint("✅ Direct session restore $sessionId");
debugPrint("✅ Direct staff restore $staffId");
// debugPrint("✅ Direct session restore $sessionId");
// debugPrint("✅ Direct staff restore $staffId");
debugPrint("🔗 Handling Notification:");
debugPrint("type=$type, value=$value, id=$notifId");
// Decide what to do based on the type
if (type == 'url' && value != null) {
navigatorKey.currentState?.push(
MaterialPageRoute(
builder: (_) => HomeScreen(
builder:
(_) => HomeScreen(
sessionId: sessionId.toString(),
staffId: staffId.toString(),
notificationUrl: value,
),
),
);
}
......
......@@ -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.
# 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
# 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
# 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
# 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:
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