-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Thesmader/development
Version 1.1.2+5
- Loading branch information
Showing
36 changed files
with
528 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+568 Bytes
gogrocy/android/app/src/main/res/mipmap-anydpi-v26/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorAccent">#5FD900</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class PlaceOrder { | ||
bool success; | ||
|
||
PlaceOrder({this.success}); | ||
|
||
PlaceOrder.fromJson(Map<String, dynamic> json) { | ||
success = json['success']; | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
data['success'] = this.success; | ||
return data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:firebase_analytics/firebase_analytics.dart'; | ||
import 'package:firebase_analytics/observer.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class AnalyticsService { | ||
final FirebaseAnalytics _analytics = FirebaseAnalytics(); | ||
|
||
FirebaseAnalyticsObserver getAnalyticsObserver() => | ||
FirebaseAnalyticsObserver(analytics: _analytics); | ||
|
||
Future setUserProperties({@required String userId}) async { | ||
await _analytics.setUserId(userId); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,58 @@ | ||
import 'package:firebase_messaging/firebase_messaging.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class FirebaseMessagingService { | ||
static final FirebaseMessaging fcmInstance = FirebaseMessaging(); | ||
|
||
static Future<String> getToken() async { | ||
Future<String> getToken() async { | ||
var token = await fcmInstance.getToken(); | ||
print("Firebase Token is $token"); | ||
return token; | ||
} | ||
|
||
void initializeNotifications(BuildContext context) { | ||
fcmInstance.configure(onMessage: (Map<String, dynamic> message) async { | ||
print('onMessage'); | ||
showDialog( | ||
context: context, | ||
builder: (context) => AlertDialog( | ||
content: ListTile( | ||
title: Text(message['notification']['title']), | ||
subtitle: Text(message['notification']['body']), | ||
), | ||
actions: <Widget>[ | ||
FlatButton( | ||
child: Text('OK'), | ||
onPressed: () { | ||
Navigator.of(context).pop(); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
}, onLaunch: (Map<String, dynamic> message) async { | ||
print("onLaunch: $message"); | ||
}, onResume: (Map<String, dynamic> message) async { | ||
print("onResume: $message"); | ||
}); | ||
fcmInstance.subscribeToTopic('pests'); | ||
fcmInstance.subscribeToTopic('weather'); | ||
print('FCM Configured!'); | ||
} | ||
|
||
static void reSubscribeWeatherHandler() { | ||
fcmInstance.subscribeToTopic('weather'); | ||
} | ||
|
||
static void reSubscribePestHandler() { | ||
fcmInstance.subscribeToTopic('pests'); | ||
} | ||
|
||
static void unsubscribePestHandler() { | ||
fcmInstance.unsubscribeFromTopic('pests'); | ||
} | ||
|
||
static void unsubscribeWeatherHandler() { | ||
fcmInstance.unsubscribeFromTopic('weather'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.