Skip to content

Commit dd2147a

Browse files
committed
Updated
Fixed Major Bugs.. Enabled In App Messaging.. Post Deletion User Profile Update
1 parent 493a0ac commit dd2147a

29 files changed

+699
-226
lines changed

.flutter-plugins

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
audioplayers=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\audioplayers-0.8.0\\
2+
clipboard_manager=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\clipboard_manager-0.0.4\\
23
cloud_firestore=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\cloud_firestore-0.8.2+3\\
34
firebase_auth=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\firebase_auth-0.6.6\\
45
firebase_core=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\firebase_core-0.2.5+1\\

.gitignore

+65-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,71 @@
1-
# See https://www.dartlang.org/guides/libraries/private-files
1+
# Miscellaneous
2+
*.class
3+
*.lock
4+
*.log
5+
*.pyc
6+
*.swp
7+
.DS_Store
8+
.atom/
9+
.buildlog/
10+
.history
11+
.svn/
212

3-
# Files and directories created by pub
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# Visual Studio Code related
20+
.vscode/
21+
22+
# Flutter/Dart/Pub related
23+
**/doc/api/
424
.dart_tool/
25+
.flutter-plugins
526
.packages
27+
.pub-cache/
28+
.pub/
629
build/
7-
# If you're building an application, you may want to check-in your pubspec.lock
8-
pubspec.lock
930

10-
# Directory created by dartdoc
11-
# If you don't generate documentation locally you can remove this line.
12-
doc/api/
31+
# Android related
32+
**/android/**/gradle-wrapper.jar
33+
**/android/.gradle
34+
**/android/captures/
35+
**/android/gradlew
36+
**/android/gradlew.bat
37+
**/android/local.properties
38+
**/android/**/GeneratedPluginRegistrant.java
39+
40+
# iOS/XCode related
41+
**/ios/**/*.mode1v3
42+
**/ios/**/*.mode2v3
43+
**/ios/**/*.moved-aside
44+
**/ios/**/*.pbxuser
45+
**/ios/**/*.perspectivev3
46+
**/ios/**/*sync/
47+
**/ios/**/.sconsign.dblite
48+
**/ios/**/.tags*
49+
**/ios/**/.vagrant/
50+
**/ios/**/DerivedData/
51+
**/ios/**/Icon?
52+
**/ios/**/Pods/
53+
**/ios/**/.symlinks/
54+
**/ios/**/profile
55+
**/ios/**/xcuserdata
56+
**/ios/.generated/
57+
**/ios/Flutter/App.framework
58+
**/ios/Flutter/Flutter.framework
59+
**/ios/Flutter/Generated.xcconfig
60+
**/ios/Flutter/app.flx
61+
**/ios/Flutter/app.zip
62+
**/ios/Flutter/flutter_assets/
63+
**/ios/ServiceDefinitions.json
64+
**/ios/Runner/GeneratedPluginRegistrant.*
1365

14-
# Avoid committing generated Javascript files:
15-
*.dart.js
16-
*.info.json # Produced by the --dump-info flag.
17-
*.js # When generated by dart2js. Don't specify *.js if your
18-
# project includes source files written in JavaScript.
19-
*.js_
20-
*.js.deps
21-
*.js.map
66+
# Exceptions to above rules.
67+
!**/ios/**/default.mode1v3
68+
!**/ios/**/default.mode2v3
69+
!**/ios/**/default.pbxuser
70+
!**/ios/**/default.perspectivev3
71+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

.idea/libraries/Dart_Packages.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Flutter_Plugins.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+113-157
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

android/app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ dependencies {
5858
testImplementation 'junit:junit:4.12'
5959
androidTestImplementation 'com.android.support.test:runner:1.0.2'
6060
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61+
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
6162
}
6263
apply plugin: 'com.google.gms.google-services'

android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io.flutter.plugin.common.PluginRegistry;
44
import xyz.luan.audioplayers.AudioplayersPlugin;
5+
import com.mranuran.clipboardmanager.ClipboardManagerPlugin;
56
import io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin;
67
import io.flutter.plugins.firebaseauth.FirebaseAuthPlugin;
78
import io.flutter.plugins.firebase.core.FirebaseCorePlugin;
@@ -23,6 +24,7 @@ public static void registerWith(PluginRegistry registry) {
2324
return;
2425
}
2526
AudioplayersPlugin.registerWith(registry.registrarFor("xyz.luan.audioplayers.AudioplayersPlugin"));
27+
ClipboardManagerPlugin.registerWith(registry.registrarFor("com.mranuran.clipboardmanager.ClipboardManagerPlugin"));
2628
CloudFirestorePlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin"));
2729
FirebaseAuthPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebaseauth.FirebaseAuthPlugin"));
2830
FirebaseCorePlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebase.core.FirebaseCorePlugin"));

cloud_functions/sendRequestNotification.js

+74-8
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,77 @@ const admin = require('firebase-admin');
55

66
admin.initializeApp(functions.config().firebase);
77

8-
exports.sendRequestNotification = functions.firestore
8+
exports.sendRequest = functions.firestore
99
.document('chatrequests/{userId}/requests/{chatId}')
1010
.onWrite((change, context) => {
11+
1112
const fromuserName = change.after.data().name;
13+
const fromUid = change.after.data().from;
1214
const toUid = context.params.userId;
13-
15+
const accepted = change.after.data().accept;
16+
1417
console.log(fromuserName);
15-
1618
console.log(toUid);
17-
18-
var userToken = "";
19+
console.log(fromUid);
20+
console.log(accepted);
1921

20-
var userRef = admin.firestore()
22+
var tokenRef = admin.firestore().collection("tokens");
23+
var toUserName = "";
24+
25+
if(accepted){
26+
var userRef1 = admin.firestore()
27+
.collection("users").doc(toUid)
28+
.get()
29+
.then(
30+
(document) => {
31+
const notifyName = document.data().name;
32+
33+
return admin.firestore()
34+
.collection("tokens")
35+
.doc(fromUid)
36+
.get()
37+
.then(
38+
(doc1) => {
39+
const token = doc1.data().token;
40+
41+
userToken.concat(token);
42+
43+
console.log("User token is : ",token);
44+
45+
var paylod = {
46+
"notification" : {
47+
"title" : "Congratulations..!!!",
48+
"body" : notifyName + " accepted your friend request",
49+
"sound" : "default"
50+
},
51+
"data" : {
52+
"sendername" : toUid,
53+
"message" : "Message"
54+
}
55+
}
56+
return admin.messaging().sendToDevice(token , paylod).then(
57+
(value) => {
58+
console.log("pushed");
59+
return admin
60+
.firestore()
61+
.collection("notifications")
62+
.add({
63+
title : "You have got a new Friend",
64+
subtitle : notifyName + " accepted your friend request",
65+
uid : fromUid
66+
});
67+
}).catch((err) => {
68+
console.log(err);
69+
console.log("Failed");
70+
});
71+
}
72+
);
73+
}
74+
);
75+
}
76+
77+
else{
78+
var userRef2 = admin.firestore()
2179
.collection("tokens").doc(toUid)
2280
.get()
2381
.then(
@@ -43,14 +101,22 @@ exports.sendRequestNotification = functions.firestore
43101
return admin.messaging().sendToDevice(token , paylod).then(
44102
(value) => {
45103
console.log("pushed");
46-
return "Hello";
104+
return admin
105+
.firestore()
106+
.collection("notifications")
107+
.add({
108+
title : "New Friend Request!",
109+
subtitle : fromuserName + " sent you a request",
110+
uid : toUid
111+
});
47112
}).catch((err) => {
48113
console.log(err);
49114
console.log("Failed");
50115
});
51116
}
52117
);
118+
}
53119

54-
console.log("User token is : ",userToken);
120+
var userToken = "";
55121

56122
});

gameOfChats.apk

1.13 MB
Binary file not shown.

ios/Runner/GeneratedPluginRegistrant.m

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#import "GeneratedPluginRegistrant.h"
66
#import <audioplayers/AudioplayersPlugin.h>
7+
#import <clipboard_manager/ClipboardManagerPlugin.h>
78
#import <cloud_firestore/CloudFirestorePlugin.h>
89
#import <firebase_auth/FirebaseAuthPlugin.h>
910
#import <firebase_core/FirebaseCorePlugin.h>
@@ -20,6 +21,7 @@ @implementation GeneratedPluginRegistrant
2021

2122
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
2223
[AudioplayersPlugin registerWithRegistrar:[registry registrarForPlugin:@"AudioplayersPlugin"]];
24+
[ClipboardManagerPlugin registerWithRegistrar:[registry registrarForPlugin:@"ClipboardManagerPlugin"]];
2325
[FLTCloudFirestorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTCloudFirestorePlugin"]];
2426
[FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]];
2527
[FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]];

0 commit comments

Comments
 (0)