Posts

Showing posts with the label firebase

How to exclude Firebase Messaging from Unity iOS builds, but not Android builds

Image
Clash Royale CLAN TAG #URR8PPP How to exclude Firebase Messaging from Unity iOS builds, but not Android builds I have a Unity project that builds for both Android and iOS. I want to integrate Firebase on my Android builds, but not for my iOS builds. Is there a way to exclude Firebase Messaging from the iOS builds completely, but keep it in for Android? I don't see the options to do so in the Firebase settings panel. I tried to unselect the Editor/iOS parts of the unity package when installing it, but I still get linker errors (when building my iOS app in Xcode) that reference missing Firebase directories. Thanks in advance, - cg By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Push notification is not working when app is in background (minimized) - IOS

Image
Clash Royale CLAN TAG #URR8PPP Push notification is not working when app is in background (minimized) - IOS I'm newbie to Swift, i am creating chat application, i need to send notification when app is in foreground or minimized. but i am not getting the notification when app is minimized (it works when USB is connected. func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { Messaging.messaging().appDidReceiveMessage(userInfo) let action = userInfo["action"] as! String let notification = UILocalNotification() notification.fireDate = NSDate() as Date notification.alertTitle = "test" notification.alertBody = "test" notification.alertAction = "Ok" UIApplication.shared.applicationIconBadgeNumber = 1 UIApplication.shared.scheduleLocalNotification(notification) completi...

My app crashes on google sign-in

Image
Clash Royale CLAN TAG #URR8PPP My app crashes on google sign-in I am integrating google sign-in into my android project using Firebase. Following this tutorial, I was able to get the login. But when I choose the account, the app crashes. By the way I am using Kotlin language. The code snippet is as follows: class SignupActivity:AppCompatActivity(){ lateinit var googleSignInClient: GoogleSignInClient lateinit var gso: GoogleSignInOptions val RC_SIGN_IN :Int =1 lateinit var signOut:Button lateinit var mAuth: FirebaseAuth private var callbackManager: CallbackManager?=null @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.signup) header_signup_button.setOnClickListener { startActivity(Intent(this,SplashscreenActivity::class.java)) } gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.defa...

Firebase CLI: the following filters were specified but do not match any functions in the project

Image
Clash Royale CLAN TAG #URR8PPP Firebase CLI: the following filters were specified but do not match any functions in the project I use Firebase Cloud Functions in my project, and I have a plenty of them so when I run the regular firebase deploy I exceed the quota, so one option is to deploy only the function that was modified by using firebase deploy --only functions:function1 as mentioned in this web page. This method works only with functions that start with: exports.funcName but when I try to use it with a function like this: Firebase Cloud Functions firebase deploy firebase deploy --only functions:function1 exports.funcName function doesNotStartWithExports() { // Does something. } It doesn't work. I use firebase deploy --only functions:doesNotStartWithExports but I get this output: firebase deploy --only functions:doesNotStartWithExports ⚠ functions: the following filters were specified but do not match any functions in the project: doesNotStartWithExports The Question...

Query firebase to return if value more then number

Image
Clash Royale CLAN TAG #URR8PPP Query firebase to return if value more then number I want to get data from Firebase. This is more or less my db structure: "Reports" : { "N06Jrz5hx6Q9bcVDBBUrF3GKSTp2" : 2, "eLLfNlWLkTcImTRqrYnU0nWuu9P2" : 2 }, "Users":{ "N06Jrz5hx6Q9bcVDBBUrF3GKSTp2" : { "completedWorks" : { ... }, "reports" : { "-LHs0yxUXn-TQC7z_MJM" : { "category" : "Niewyraźne zdjęcie", "creatorID" : "z8DxcXyehgMhRyMqmf6q8LpCYfs1", "reportedID" : "N06Jrz5hx6Q9bcVDBBUrF3GKSTp2", "resolved" : false, "text" : "heh", "workID" : "-LHs-aZJkAhEf1RHVasg" }, "-LHs1hzlL4roUJfMlvyA" : { "category"...

Gradle Code having Red Line Under the Code and App not Install On Virtual Or Real Device

Image
Clash Royale CLAN TAG #URR8PPP Gradle Code having Red Line Under the Code and App not Install On Virtual Or Real Device I am working on an Android App Until I face a problem that App is not able to install after the successful built and When I open my gradle file It shows a red line under the appcompat Implementation. I am confused how to resolve It since app I am not able to install app on Real Or Virtual Device. Here is Dependancies in Gradle code dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) **implementation 'com.android.support:appcompat-v7:28.0.0-beta01'** implementation 'com.android.support.constraint:constraint-layout:1.1.2' implementation 'com.google.firebase:firebase-auth:11.8.0' implementation 'com.google.firebase:firebase-database:11.8.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.sup...

Resolving typescript

Image
Clash Royale CLAN TAG #URR8PPP Resolving typescript How do I work with Firebase and my own Typescript interfaces? ie. I have a function here that I'm going to need the full Payment object, (not just the delta), so I get that via the DocumentReference object. Payment DocumentReference exports.resolveStripeCharge = functions.firestore.document('/payments/{paymentId}') .onWrite((change : Change <DocumentSnapshot>) => { change.after.ref.get().then((doc: DocumentSnapshot )=> { const payment : Payment = doc.data(); }) [ts] Type 'DocumentData' is not assignable to type 'Payment'. Property 'amount' is missing in type 'DocumentData'. const payment: Payment I get that the returned object wont necessarily conform the interface - but in anycase -what should I do here - if I want to enforce typing? Do I just use: const payment : Payment = <Payment>doc.data(); Or is there a much nicer solution? ...

Not showing TEST ads and REAL add Rewarded Video by Admob for Android

Image
Clash Royale CLAN TAG #URR8PPP Not showing TEST ads and REAL add Rewarded Video by Admob for Android I am facing an error from last week, please help me better. I implement RewardedVideo by Admob but I am getting error 3 and some time error 0 .this both error facing me when I try both test ads and real ads . RewardedVideo Admob error 3 error 0 test ads real ads My Code is below . private RewardedVideoAd mRewardedVideoAd; Button adsShow; private static final String TAG = "MainActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); MobileAds.initialize(this, "ca-app-pub-3940256099942544/5224354917"); mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this); mRewardedVideoAd.setRewardedVideoAdListener(this); loadRewardedVideoAd(); adsShow=(Button)findViewById(R.id.mainidads); adsShow.setOnClickListener(new View.OnClickListener() { ...

Failed to resolve: com.google.firebase:firebase-core:16.0.1

Image
Clash Royale CLAN TAG #URR8PPP Failed to resolve: com.google.firebase:firebase-core:16.0.1 I'm trying to add firebase cloud storage to my app. Below is the app build.gradle. But it says: Failed to resolve: com.google.firebase:firebase-core:16.0.1. Why? There is no firebase-core in the dependencies at all. apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "com.louise.udacity.mydict" minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com....

Firebase Query don't show all the data

Image
Clash Royale CLAN TAG #URR8PPP Firebase Query don't show all the data I need to get all users of a determined age range, but my code does not work. My Firebase database structure is this. -user -1 -name:"James" -age:"21" -2 -name:"Artur" -age:"25" -3 -name:"Charlotte" -age:"25" -3 -name:"Marvin" -age:"80" My code is this. With this I just catch 1 user. DatabaseReference uRef = database.getReference("users"); Query UserQuery = uRef.orderByChild("age").startAt(21).endAt(50); UserQuery.limitToFirst(10).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { int counter =(int) dataSnapshot.getChildrenCount(); Log.d("TAG////////", String.valueOf(counter)); } @Override public void onCancel...

Application does not show Firebase - Recyclerview [on hold]

Image
Clash Royale CLAN TAG #URR8PPP Application does not show Firebase - Recyclerview [on hold] I am having a big problem, my application does not display the data that is in the firebase, but also does not present any error, they can help me: This is my Fragment: View v; private RecyclerView mRecyclerView; private List<Adapter> listStore; private DatabaseReference mStoreDatabase; private RecyclerViewAdapter recyclerViewAdapter; private RecyclerView mResultList; public Sema_Fragment() { // Required empty public constructor } @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { v = inflater.inflate(R.layout.fragment_sema_, container,false); mRecyclerView = (RecyclerView) v.findViewById(R.id.recycler_view); recyclerViewAdapter = new RecyclerViewAdapter(getContext(),listStore); mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mRecyclerView.setAdapter(recyclerViewAdapter); ...

Get single record from Firestore using Vue.js

Image
Clash Royale CLAN TAG #URR8PPP Get single record from Firestore using Vue.js I am trying to get a single record from a Firestore db where I am pulling the ID from the path but it doesn't seem to be working. When I console log I get nothing at all in the log so not sure why the created code doesn't seem to be running Can you see what I am doing wrong please // Import firestorm Database import db from '~/services/fireinit.js' export default { data() { return { post: } }, created() { let ref = db.collection('post').doc(this.$route.params.id) ref.get() .then(snapshot => { snapshot.forEach(doc => { let post = doc.data() console.log(post) }) }) } I should add that get all works fine db.collection('post').get() my console.log returns nothing even if I add a string to it so it doesn't appear this block of code is running, but I have no errors at all in the console. ...

How to get values inside nested keys in Firebase on Swift

Image
Clash Royale CLAN TAG #URR8PPP How to get values inside nested keys in Firebase on Swift I'm trying to get values inside two nested keys in Firebase. : I need to put all the value of name inside an array. Here is my code where I'm accessing just the node "user". I was thinking that I could use "queryOrderedByKey" one after another, but in that case xCode crashes and says something like multiple quires aren't allowed. Database.database().reference().child("user").queryOrderedByKey().observe(.childAdded) { (snapshot) in if snapshot.value != nil { let result = snapshot.value as! [String : AnyObject] if let name = result["name"] as? String { self.myArray.append(name) } DispatchQueue.main.async(execute: { self.tableView.reloadData() }) } } And this is what I'm getting when printing the result. ...

Android - Memory Cost - Firebase Realtime Database x Room Persistence Library

Image
Clash Royale CLAN TAG #URR8PPP Android - Memory Cost - Firebase Realtime Database x Room Persistence Library Debugging Firebase Realtime Database method ValueEventListener.onDataChange , DataSnapshot loads all data from the Cloud. ValueEventListener.onDataChange DataSnapshot Thinking in low memory cost, what is the best solution to work with the large amount of data ( in device perspective )? Im looking to implement both, using Firebase Realtime Database to do a daily update to storage local data with the Room Database. For this way, only necessary data is loaded to device's memory, based on user interaction. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Update alpha of image inside UICollectionViewCell

Image
Clash Royale CLAN TAG #URR8PPP Update alpha of image inside UICollectionViewCell I have a list of an object that have image inside it, I upload the image in this object to firebase storage after showing it inside a collectionviewcell, every thing is work correctly but I need change the alpha of image inside the uicollectionviewcell according to progress of uploading it to firebase storage, what I try the following: class MediaItem :Codable { var id : Int? = 0 var url : String? = "" var pickedImage = UIImage() var currentState:State = .none var progress:Float = 0 func start () { currentState = .uploading var data = Data() data = UIImageJPEGRepresentation(self.pickedImage, 0.8)! // Create a root reference let storageRef = Storage.storage().reference() let imageName = NSUUID().uuidString // Create a reference to the file you want to upload let imageRef = storageRef.child("images/(imageN...

Flutter Firebase Auth

Image
Clash Royale CLAN TAG #URR8PPP Flutter Firebase Auth I'm developing flutter app and I added firebase auth to project. And it's running fine, but when app loads up console says this. Is this normal behavior? Thank you! 5.4.1 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.