Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Apple CloudKit — Gideros Forum

Apple CloudKit

totebototebo Member
edited December 2014 in Plugins
Hi,

Has anyone implemented Apple's CloudKit with Gideros? Is there a plugin for it?

Cheers,

Niclas
My Gideros games: www.totebo.com

Comments

  • I actually don't know if it's the same thing. Maybe someone else?
    My Gideros games: www.totebo.com
  • jdbcjdbc Member
    edited December 2014
    https://developer.apple.com/icloud/documentation/cloudkit-storage/

    I guess that CloudKit is focus on storage in the cloud not only for gaming. Apple says developers do not need to write server-side code for save data on the cloud.
  • Has someone used the Gaming plugin with cloud saves for iTunes and Google Play recently?

    Gaming:loadState(key)
    Gaming:updateState(key, data[, immediate])
    Gaming:deleteState(key)
    Gaming:resolveState(key, version, data)
    My Gideros games: www.totebo.com
  • I can't find any documentation as to how to use cloud saves with the Gaming plugin (including setting it up on iTunes and Google Play). Can someone point me in the right direction?
    My Gideros games: www.totebo.com
  • No one?!
    My Gideros games: www.totebo.com
  • Here are some snippets...
    				googleplayG:addEventListener(Event.STATE_LOADED,function(e)
    					print("googleplayG STATE_LOADED")
    					processLoad(e)
    				end)
    				googleplayG:addEventListener(Event.STATE_ERROR,function(e)
    					print("googleplayG STATE_ERROR:"..e.error)
    				end)
    				googleplayG:addEventListener(Event.STATE_CONFLICT,function(e)
    					print("googleplayG STATE_CONFLICT")
    				end)
    				googleplayG:addEventListener(Event.STATE_DELETED,function(e)
    					print("googleplayG STATE_DELETED")
    				end)
    googleplayG:loadState(0)
    function processLoad(e)
    	if e.key==0 then
    		if e.data and e.data~="" then
    			local savedata=json.decode(e.data)
    			if savedata then
    				local loopMax=#savedata
    				if loopMax>levelMax then
    					loopMax=levelMax
    				end
    				lev=1
    				for loop=1,loopMax do
    				-- stars
    					if scores[loop][1]<savedata[loop][1] then
    						scores[loop][1]=savedata[loop][1]
    					end
    				--highscore
    					if scores[loop][3]<savedata[loop][2] then
    						scores[loop][3]=savedata[loop][2]
    					end
    					if scores[loop][1]>0 then
    						lev=loop+1
    					end
    				end
    				if lev>currentLevel then
    					fullMapDraw=true
    					if lev>levelMax then
    						lev=levelMax
    					end
    					if lev>=(cloudLevel-1) then
    						lev=cloudLevel-1
    					end
    					currentLevel=lev
    					print("*** Current level: "..currentLevel)
    				end
    			end
    		end
    	end
    end
    				print("saving 0 to google")
    				googleplayG:updateState(0,saveString)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • (the savestring being the opposite json of savedata)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Thanks! This looks what I implemented when testing, but on iOS. In my case nothing is returned when loadState is called.

    I have enabled cloud kit in my app, and it shows up in the iTunes console. But I get no responses at all when calling the cloud services. Not even a nice little random crash. :)

    How do I set this up properly? Is there a guide? How does it work on Google Play?
    My Gideros games: www.totebo.com
  • I set it up the same on iOS (from what I remember, it's been over 12 months)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Ok cool. Did you test your app in 2016.8.2? I guess not, but doesn't hurt asking. :)
    My Gideros games: www.totebo.com
  • I didn't - I dread even trying to submit to apple as you have guessed. I will do soon though, promise! :)

    Likes: totebo

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • theone10theone10 Member
    edited March 2018
    Hi,

    Im finishing my game, but Im having the same problem as @totebo comented

    "I have enabled cloud kit in my app, and it shows up in the iTunes console. But I get no responses at all when calling the cloud services. Not even a nice little random crash. "

    On googleplay services all works nice, but with ios nothing happened.

    my code is like this.

    - loggin to game center
    - if error i created a game in local
    - if loggin completed then loadstate(0) (here i check if there are a key created or not)
    but STATE_LOADED or STATE_ERROR doesnt work, so my game wait until infinite.

    Im testing in the last xcode version, with last gideros version (2018.2.1) in simulator.

    i have configure my apple id with icloud services like apple help says.

    any idea? or someone with same problem?

    thanks :smile:
  • Just tried in a real device, and nothing happens too. (Im testing with key-value storage)
  • ok, i think i found the solution ... at least state_loaded and state_error works now.

    in gaming ios plugin, inside frameworks folder/ GameGamekit.m:

    I commented lines where self.ubiq is check. I think ubiq container is old thing of ios, now depends of icloud container, so plugin never gets self.ubiq url, so loadstate function now works like this:

    -(void)loadState:(int)key{
    // if(self.ubiq) { --- I commented this to uncheck the never declarate self.ubiq
    [GameClass stateLoaded:[self class] with:key with:[[NSUbiquitousKeyValueStore defaultStore] objectForKey:[NSString stringWithFormat:@%d, key]] with:1];
    // }
    }

    the same for all methods where self.ubiq is check


    I think plugin should be update in next realease :) @SinisterSoft @ar2rsawseen @hgy29

    thanks for this great engine guys :)

    +1 -1 (+2 / -0 )Share on Facebook
  • Are you fixing/trying this @totebo ?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • Hey, not actively! :) I haven't got a project that needs it at the moment, but may have a bash if I start one. Although I may go with Xtralife instead, which seems more flexible.

    Likes: SinisterSoft

    My Gideros games: www.totebo.com
    +1 -1 (+1 / -0 )Share on Facebook
  • XtraLife is great! :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.