How to find out WHEN a user bought the app / installed it for the first time (possible without UDID?)

三世轮回 提交于 2019-11-30 20:22:41

You can just store a flag in the keychain. The contents of the keychain are preserved across app reinstalls.

To get the first installation time of your app, check when the first time the app binary has been written to disk:

if (flag_in_keychain_not_present()) {
    // installed for the first time
    set_flag_in_keychain();

    struct stat st;
    stat([NSBundle mainBundle].executablePath.UTF8String, &st);
    time_t installed = st.st_mtime;
}

I haven't used Store Kit yet, but tell me if I'm wrong,

1) it requires a server at a point or another

2) when we use it to "buy" (not a subscription or a consumable) something we can retrieve this purchase on all devices using the same iTunes Account

My point, create a in app purchase free item, when it passes through you server the first time store it in a database and next time it is called with the same account "enable" the issue corresponding to the first free purchase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!