Request Notifications Permission required for Android 13 and above
parent
9ddfb5cfd5
commit
f866e187ae
|
@ -1,6 +1,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
<application
|
||||
android:label="cofounderella"
|
||||
android:name="${applicationName}"
|
||||
|
|
|
@ -26,6 +26,8 @@ void main() async {
|
|||
|
||||
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>()?.requestNotificationsPermission();
|
||||
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||
AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||
const InitializationSettings initializationSettings =
|
||||
|
|
|
@ -50,7 +50,7 @@ class SwipeStreamService {
|
|||
String matchName = await UserService.getUserName(swipeId);
|
||||
const AndroidNotificationDetails androidPlatformChannelSpecifics =
|
||||
AndroidNotificationDetails(
|
||||
'my_match_channel_id', 'my_match_channel_name',
|
||||
'new_matches_channel_id', 'new_match_info',
|
||||
channelShowBadge: true,
|
||||
visibility: NotificationVisibility.private,
|
||||
importance: Importance.max,
|
||||
|
|
|
@ -45,7 +45,8 @@ String convertDecimalToDMS(double decimalValue, {required bool isLatitude}) {
|
|||
double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
|
||||
const R = 6371; // earth radius in kilometers
|
||||
|
||||
// distance between latitudes and longitudes
|
||||
// Haversine formula to get distance between latitudes and longitudes
|
||||
// https://en.wikipedia.org/wiki/Haversine_formula
|
||||
final dLat = _degreesToRadians(lat2 - lat1);
|
||||
final dLon = _degreesToRadians(lon2 - lon1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue