Cannot restore lifetimevirtualgood item that was given as a gift - c++

I use this method
soomla::CCStoreInventory::sharedStoreInventory()->giveItem(REMOVE_ADS_ITEM_ID, 1);
to give player one remove-ads item. After that, player remove and reinstall app again and click on Restore Purchase button but no remove-ads item is restored.
I'm so confused that given item cannot restore or there are somethings I missed? Please help.

The restore functionality works by looking up what IAPs the user owns (on the App Store/Google Play/etc.), and gives each non-consumable locally so that Soomla knows about it.
Since you're just giving the item locally directly, restore items has no idea that the item was granted (since you're wiping the data that says it was). It's still only looking at the official stores.
What you can do is sync what items the user owns to the cloud, and restore from that, using a UID. If you want complete control, this is the best bet, but that involves your own servers and coming up with a way of generating UID purely from device information, and not one-size-fits-all. Then you'd give the items locally when you can verify that the same user owns it on your server.
But there is an easier way. Soomla has an official implementation where they do all of this for you: Grow Sync.
Update (May 2016): Soomla is now shutting down Grow Sync, Highway, etc. so you can no longer rely on those services.

Related

GCP Console - prompt to refresh the page

Several of GCP accounts I use display a message after logging in:
Refresh the page?
Now that you’ve upgraded, we need to refresh the page so you can take advantage of the new capabilities of your account. Do you want to refresh the page now, or do it yourself later?
Does anyone else see similar message? Wonder what kind of upgrade it relates to, I don't remember making any changes to the account recently. Hitting OK, refresh now doesn't produce any visible changes. Also it seems there is no way of making this message disappear - acknowledging or rejecting will still trigger a popup on next login.
popup screenshot
I guess the developers/engineers the project is shared with are making some changes. Well as per my observation, whenever one makes a change in GCP, it automatically gets reloaded or the necessary changes take place in background, but when others are working at same project at the same time, then if one user makes any changes in a shared access resource, then other users might need to reload the site for the necessary changes to take place.
I would highly suggest you contact other developers/engineers you are sharing the project with to check if they made changes in the project or not.
Hope this helps. Cheers :)

WHM Cpanel / AWS hosting, this partition is full, how?

I've got this hosting account with AWS, and I had a partition that was getting really full. So I hired someone to create a new partition and he showed me how to migrate a few accounts into the new partition.
I thought this would bring down the amount of data that was in the near full partition, but it hasn't.
See from the screenshot, what is called 'home3' is totally full, and 'home4' (the new partition) is slowly filling up.
I'm assuming home3 is full of backups or something.
How do I clean up home3 without messing with command line tools? Or, do I need to hire a real pro to do this? Is there something in WHM that allows me to do a clean up? Because if there is I can't find it.
If you are not sure what is stored in /home3 partition, you should hire server admin to check and perform necessary migration for you. Before you delete any data, you should know whether those data are important or not.
Also, in some cause, it requires a server reboot after deleting or moving data from full partition. Actual free space should be reflected after server reboot.

Timeline items on Glass file structure

I assume that the cards on the timeline are stored locally on Glass - I was wondering if details about where and how they are stored is available. I see the images are stored in a particular cache folder, but not sure about how they are organized. Or is this something that Google doesn't want played with at this point?
I was trying to reorganize timeline items (via mirror) into bundles by content-type and forgot about the restrictions via oauth, so I assume a native or root application would be required.
The local timeline items are organized by time received.
I think that the timeline items are being hosted somewhere else. GLASS then syncs up(I think using GoogleCloudMessaging) with the hosted timeline and the items are then fetched and stored locally.
I'm not sure if this answers your question, however, I want to bring this thread back up. I was about to ask the same question regarding the hosting of the timeline items of both scenarios.

iOS application with local and iCloud support

If the ubiquity container (iCloud folder) is not available for whatever reason, I add any new documents to the users 'Documents' directory, however, should it become available again I add the documents to the ubiquity container.
My question is, what is the best method to saving documents seen as a ubiquity container is so unreliable?
For example, if a user switches off documents in the cloud, those documents are deleted. Is there a notification to listen out for when this happens so I can transfer them to the local directory?
And vice versa, if a user switches the documents in the cloud on, is there a notification to move documents from local to ubiquitous store?
Thanks
No automatic notification, the files in the ubiquity container either disappear or reappear. Your app logic has to take account of what files need moved into and out of iCloud when they're visible to you, but once they're gone, they're gone!
IMHO, having data disappear is one of the most user-confusing things about iCloud. The user expects it to sync stuff, but it's an all or nothing game at the moment. The only way around this if you really want more 'sync like' behaviour is to have both a local non-ubiquity copy, AND a copy in the local ubiquity container so it gets uploaded to the iCloud servers. That then means you've effectively got two copies of everything on every device. Messy.
Much easier to stick to the Apple mandated method, and assume the user knows what they're doing if they log out of iCloud, or delete your data from iCloud.

Should app allow user to switch iCloud on or off?

The Apple documentations says:
When a user launches your iCloud-enabled app for the first time,
invite them to use iCloud.
Never prompt the user again about
whether they want to use iCloud vs. local storage.
What if the user does not pick iCloud the first time, but decides to use it later?
What if after using iCloud for a few days, the user decides to switch back to local storage?
What if a user runs out of iCloud storage space, but does not want to pay for additional space?
Should an app be designed to allow users to toggle between local and iCloud storage? If yes, what's the best way to deal with this?
Thanks.
Yes, you definitely need to be able to migrate a user between the two storage methods, for the reasons you include above plus more - what if the user signs out of iCloud? And what if that is followed by another iCloud user signing in? You need to handle this stuff and be able to move things when you can and even when you can't do that, save stuff in the right place and where the user expects.
How you handle it will depend on what types of iCloud storage you are using. For the key value store, you should also be caching that stuff locally (it's not an NSUserDefaults substitute).
For document and Core Data, you can sometimes migrate persistent stores back into local stores, and you can sometimes move documents out of iCloud to local storage. I'd recommend reading both the Document Programming on iOS guide and the iCloud guide to get at least a base idea of how to handle this.
One thing that can be tough is detecting some of these changes - the APIs are a bit underbaked in this regard. One technique that is used by some are 'sentinel files' that you place in ubiquity - if they're missing, you know that the iCloud universe as you knew it has changed.
Take a look at how Apple's apps handle this, like iWork. There's an iCloud switch in their settings bundle.