Google Clould Messaging (iOS) put files in default app Documents folder - ios

I would like to turn on UIFileSharingEnabled to let users of my app save some files in their pc.
The problem is that a Google library is putting files inside the main Documents folder of my app without letting me specify a different destination.
This way, if I turn on UIFileSharingEnabled, this is what the user can see and interact with (download or delete!)
The 3 folders are mine, so I can move them out easily, but the 3 .plist files are a problem. I cannot move them without breaking google functionalities.
I use Cocoapods for loading them inside my project.
pod 'Google/Analytics', '1.0.7'
pod 'Google/CloudMessaging', '1.0.7'
Any idea on how to fix this? I'm stuck in this situation.
Thanks

UPDATE: This issue is finally fixed in Firebase version 3.4 from 1 Aug 2016: "plist files used by FIRMessaging are now stored in an ApplicationSupport directory." (source)
Six months later I have the same problem. It turned out GCM developers have failed to fix this bug. I opened another issue (here) and they confirmed this is not fixed yet. In the meantime Google have announced Firebase Cloud Messaging will inherit GCM. I removed GCM form my app and integrated Firebase. However the issue is still reproducible. These four files are created upon app launch:
com.google.iid-keypair.plist
com.google.iid-tokens.plist
g-checkin.plist
rmq2.sqlite
I've logged a bug request to Firebase support. I'll update my answer when I see this issue fixed.
Till then I do not recommend to use Firebase Messaging in an iOS application. Your app may be rejected from the App Store for writing temp files to Documents directory.

Just so you know, I reported the issue on github.
https://github.com/google/gcm/issues/120
Yesterday a Google guy said it will be fixed in the next version! Yeah!

Related

How to fix if App rejected for using UIWebView in code?

I have been trying to upload an iOS app to Appstore but its only appearing on "Activity" tab for 3-5 minutes and then disappears.
Then I got an email from Apple saying that my app is rejected because it is using UIWebView in one of the view controller. I deleted that particular screen and reuploaded the app and had the same error email.
Then I checked my third-party sdks like FacebookLoginSDK and GoogleSignInSDK and updated those and then checked that if the app has no UIWebView which it did not. Then i reuploaded the app but this time again I had the same error email. I have searched the whole storyboard source code and the whole app code to look that if there is any sign for UIWebView but there is nothing, but still I am getting this email.
I also tried deleting 'Derived Data' folder several times and cleaning the build folder also but nothing helps.
On the other hand I have uploaded a different app today which had UIWebView and it got approved but I also got the same email for not using UIWebView.
Does anybody had this kind of experience or can anybody tell me whats going on ?
I got the same issue before.
If you have uploaded the build and showing it in activity tab for few minutes then its not mean that issue is only about UIWebview but there can be some other issue as well.
I have uploaded my app n got the mail related to UIWebview, so I coverted the UIWebview to WKWebView and again I uploaded but that time same thing happend.
I failed to tackle the problem.
Then I mailed to Apple Developer Support and they replied like
Any of the third party library internally using some privacy data you should ask permission for the same.
Then I checked Info.plist, I have given each permission in list still how it comes that we don't understand.
Finally then after whole search the one third party library internally using motion related data without permission so this happened.
Then I have added that in plist and then again uploaded and its approved.
So please you can check your info.plist and also check whether your third party library using any privacy sensitive data without permission or not.
May it help you at some point.
Make sure you update all your plugins to the latest version!
Check this: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation where you can find the plugins that have known issues concerning the old WebView usage.
But be aware that uninstalling and re-installing some plugins will NOT will not install the latest available version of the plugin!
So to be sure that you are re-installing the latest version of a plugin, go to the github repository of the cordova plugin and search for the plugin.xml file and open it. Then, copy the version string found in the root xml element.
Finally, install the plugin like that: ionic cordova plugin add plugin_name#copied_version
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-firebase" version="2.0.5"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<name>Google Firebase Plugin</name>
...
...
...
</plugin>
Are you using the AdMob plugin?
It is not enough to check for the absence of "UIWebView" strings!
You have to make sure that all third party plugins are up to date.
One of the trickiest situations I had went to is when I had tried to update an app (using AdMob) on the AppStore after Apple started rejecting apps using the UIWebView.
The generated iOS source code has no UIWebView references, but still rejected!
After a long headache, I realized that the Google AdMob SDK version I'm using is out of date, knowing that I had updated the AdMob plugin from the CLI, but it seems that the SDK is not updated when updating from the npm.
Finally, I had downloaded the latest AdMob SDK from this link https://developers.google.com/admob/ios/download and replaced it in the source code of the AdMob SDK plugin. Then I had followed the instructions found in this link https://developers.google.com/admob/ios/quick-start to update the code in the xCode.

Crashlytics not sending events on iOS

I've migrated our app from react-native-firebase to #react-native-firebase/crashlytics and managed to get crash reports from Android, but no luck with iOS.
I've done all the following:
removed react-native-fabric and all of it's references
installed #react-native-firebase/app
installed #react-native-firebase/crashlytics
added GoogleServices-info.plist in xCode as described in the manual
added firebase.json in the root of the app with crashlytics_debug_enabled: true (this solved Android)
But still no success, not from the simulator nor from appCenter deployed app.
I think it's good to mention that we have 3 schemes (dev, staging, production).
Any idea how to make this work?
Chintan from Firebase. Can you reach out to Firebase Support with the bundle ids of all 3 variant? You can also reference this SO post in there. It might just need manual activation.

Firebase storage download trouble in iOS device (Unity)

I met unknown trouble trying to setup firebase storage for iOS. I can't download even 1 file in device, but it runs perfectly in Editor.
I am using reference.GetFileAsync() method. Firstly I assumed that I made some wrong package setup or some other silly mistake, but I checked it many-many times. Each Quickstart project here works well on my end. My current project settings and firebase storage settings are identical to provided test examples I run in iOS device successfully.
Here is a xCode output trying to download the file. That is looped and contains only that info: codeshare
Any of logs googling doesn't give me any solution or even idea.
Please, give me some thoughts where to search the problem.. I am totally confused.
I am using MacOSx, Unity 5.5.0/5.5.1, latest Firebase Unity SDK (v1.1.2)
The reason was that firebase database package automatically changed from .NET Subset to .NET option. Changing back solved the problem. But anyway, that means we can't use firebase storage + database in same iOS project in Unity.. That's bad
Firebase Developer here. I'm sorry you encountered this error and I can confirm this was a regression from our initial build in January. This issue has since been resolved in the latest version of Firebase Storage for Unity (3.0.0.0) released for general availability for mobile at GDC.
The latest version will work with the full .Net SDK which is also required for the realtime database in Unity.

Could not configure Firebase InstanceID

hi I'm trying to include firebase in my app and followed the documentation, when I'm trying to do google sign in, Could not configure Firebase InstanceID error occurs .please advice how to overcome this error
There are two things to check (and hopefully, one will fix it for you):
Make sure your BundleIdentifier is exactly the same in your Firebase project as it is in your Xcode, i.e. com.[yourcompany].[yourappname]
Make sure you got the latest GoogleService-Info.plist file. Go to Firebase Console -> Settings -> Your Application - there will be a blue button to the right that lets you download new configuration file
That solved it for me.
Bug Details
As of version 3.13.0, there appears to be a bug in the Firebase/Core SDK.
I added a symbolic breakpoint at -[FIRInstanceID(FIRApp) configureInstanceIDWithOptions:app:] and stepped though the assembly.
It appears that FIRApp.configure() is ignoring the IS_GCM_ENABLED flag in the GoogleServices-Info.plist and tries to configure GCM regardless of the flag's state. In my case, because my project does not use GCM, the app would crash because there was no GCM_SENDER_ID in the plist.
Workaround
Add a dummy value (i.e. 123456789012) for GCM_SENDER_ID within the GoogleService-Info.plist file. This will allow the application to configure successfully.
You have to add your project which is created on
https://developers.google.com/mobile/add?platform=ios or fire base console into your Firebase dashboard.
Now you can download GoogleService-Info.plist from Firebase and import into your project.
I setup Firebase in code using FIROptions. In my case, I was missing gcmSenderID, fixing it then it works
Firebase DevRel here. This should be an error, unless you enabled gcm, you shouldn't go through instanceid setup. Filed internally.
For now, the workaround is manually changing "IS_GCM_ENABLED" to "NO" in your "GoogleService-Info.plist" file
I was getting this error as I didn't have my GoogleService-Info.plist in my Test folder as well. ( if you are using TDD)
As of the latest Firebase Core 3.16.0 - I seem to need to include it in my main project as well as copying a version into my Test Root.
This also happens when you shift your google SDK integration from one account to another and don't edit the API keys on application side.Make sure when you shift from one google account to another, you re-visit all the SDK guides again like FCM, Google Sign-in etc and make sure you are using new API keys (client_id, URI Scheme) in application.

GoogleService-Info.plist not created

I'm upgrading from an earlier version of Google Analytics for my iOS app and when I follow the instructions here, I click the button to create a configuration file and nothing happens. Anyone else experience this? Is there a default GoogleService-Info.plist that I can use and customize?
Thanks!
Seems to be a bug on their site. It worked for me 2 weeks ago. However you have already found Googles Guide - the config file does not contain any complicated settings, however you can download the Sample Apps and get your initial GoogleService-Info.plist file from there:
pod try Google
from
https://developers.google.com/maps/documentation/ios-sdk/code-samples#try-the-sdk-demos-using-cocoapods
Steps for getting configuration if your first time login to google developer account.
1. open google developer console.
2. login to developer console.
3. create project with valid name.
4. then goto the API section & enable GCM API.
5. Then get the configuration file.
Thanks for the suggestions, looks like they would work for others. Unfortunately, I just couldn't get Cocoa Pods to upgrade the analytics, so I switched tactics and used the sdk directly. This worked fine, hopefully others have better luck!

Resources