Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!)

Files inside app Documents folder

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

like image 633
DrAL3X Avatar asked Oct 31 '22 17:10

DrAL3X


1 Answers

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.

like image 112
Vladimir Grigorov Avatar answered Nov 09 '22 08:11

Vladimir Grigorov