sdkbox / issues

The issue tracker for SDKBOX
MIT License
4 stars 0 forks source link

IAP iOS creates tracking_urls in document folder : how to avoid it? #29

Closed siarsky closed 6 years ago

siarsky commented 6 years ago

With an SDKBOX IAP purchase module active a file "tracking_urls" is being created in document folder /var/mobile/Applications//Documents/ with this content:

[ "https:\/\/metrics.sdkbox.com\/?{\"AndroidId\":\"\",\"App\":\"*\",\"CDID\":\"****\",\"CocosVersion\":\"v3\",\"IDFA\":\"\",\"ProjectType\":\"cpp\",\"SdkboxHost\":\"Cocos2dx\",\"SdkboxVersion\":\"sdkbox V2.3.17.1\",\"app_package_id\":\"**.*****..**\",\"app_token\":\"\",\"billSupport\":true,\"country_code\":\"CH\",\"data\":\"2.1.0\",\"device\":\"iPhone\",\"event\":\"init\",\"latitude\":\"-1.0\",\"longitude\":\"-1.0\",\"os_version\":\"..\",\"platform\":\"ios\",\"plugin_key\":\"\",\"plugin_name\":\"IAP\",\"plugin_version\":\"2.1.0\",\"store\":\"apple\",\"timestamp\":\"****\"}" ]

Due to functional requirements the application I am working on needs to have an activated access to files over iTunes by setting UIFileSharingEnabled to TRUE in Info.plist.

I patched FileUtilsApple::getWritablePath() in CCFileUtils-apple.mm:

OLD:

// save to document folder NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NEW:

// save to data folder NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);

so all internal files are stored not in the document folder but in the data folder (/var/mobile/Applications//Library/Application Support/).

This is necessary, otherwise the app will get rejected by Apple, with a comment similar to this:

When file sharing is enabled, the entire Documents folder is used for file sharing. Files that that are not intended for user access via the file sharing feature should be stored in another part of your application's bundle. If your application does not require the file sharing feature, the UIFileSharingEnabled key in the Info.plist should not be set to true.

tracking_urls is apparently not intended for user access - and therefore some questions:

  1. what is the purpose of this tracking file?
  2. can this file be deleted?
  3. is there a way to disable creation of this file?
  4. is there a way to let create the file in other than document folder (by setting a parameter or so)?

Thanks for you help siarsky

ghost commented 6 years ago

we have fixed this issue now, release ASAP.

ghost commented 6 years ago

It's safe to delete.

siarsky commented 6 years ago

Thank you for your incredible fast support!

Could you please give me more information to the fix, so that I know how to test it?

  1. will the file "tracking_urls" not stored anymore on iOS? OR
  2. it will be stored in data folder instead of document folder in iOS? OR
  3. SDKBOX plugin uses cocos2dxFileUtilsApple::getWritablePath() routine and save always into the same folder as configured in cocos2dx (I do not believe this is the case, too heavy dependency)? OR
  4. some other solution?

I see still no update:

$ date Tue Nov 14 21:15:18 CET 2017 $ sdkbox update Copyright (c) 2016-2017 SDKBOX Inc. v1.0.1.24 test speed of hosts...

ghost commented 6 years ago

releasing a staging version.

SDKBOX plugin uses cocos2dxFileUtilsApple::getWritablePath() routine and save always into the same folder as configured in cocos2dx (I do not believe this is the case, too heavy dependency)?

No, SDKBox do not depends cocos2dx, we have a internal completion about the getWritablePath.

it will be stored in data folder instead of document folder in iOS? will store data in cache folder.

siarsky commented 6 years ago

Hi @yinjimmy,

any information, when the fix will be released? Currently I still see no new update:

$ sdkbox update _______ ______ _ _ ______ _____ _ _ |______ | \ |____/ |_____] | | \___/ ______| |_____/ | \_ |_____] |_____| _/ \_ Copyright (c) 2016-2017 SDKBOX Inc. v1.0.1.24 test speed of hosts... - test host main: 12.34KB/s. - test host china: 11.36KB/s. choose the fastest server 'main', speed is 12.34KB/s. 2.3.17.1 2.3.17.1 all packages are up to date.

siarsky commented 6 years ago

The problem is fixed in 2.3.17.3 even not mentioned in release notes of the realease.

Issue closed