Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Application / System Events — Gideros Forum

Application / System Events

OZAppsOZApps Guru
edited November 2013 in General questions
While most of the system events are handled like applicationStart, applicationStop, applicationResume and applicationSuspend, what about the applicationOpen or equivalent that would basically handle the handleOpenUrl function?

could that be added or is it already available?

There is a function gdr_handleOpenUrl(url); not sure what this function does or how to access this from inside of Gideros.
twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps

Comments

  • @OZApps there is an applicationOpen event for the plugins, to pass the arguments to other plugins, like facebook, to make their url scheme work. You can check out the source for facebook ios plugin
  • @OZApps there is an applicationOpen event for the plugins, to pass the arguments to other plugins, like facebook, to make their url scheme work. You can check out the source for facebook ios plugin
    Hmmm, so it cannot be used in the app, just plug-ins? Would it be easy to add an event to the Application object? that way if someone wants to capture it in a plug-in fine, but if not, it is still available (in pure Lua, without having the plug-in overhead and complexity)
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Oh yeah, this might be because i'm stupid, but it's funny that this happened to me.

    When doing deep linking on iOS with facebook, i'm stupidly using "code" as my deeplink string, and the result, it crash my app.
    This is because facebook also send "code" when they do authorize, it can be changed on App setting at developer.facebook.com, but it still crash your app if you use "code" deeplinking.

    So, sometime we need to be careful on choosing deeplink string name.

  • Well, it would be great if it added on event.
    Since i'm having so much trouble on getting the string and sending it to the app.
  • When doing deep linking on iOS with facebook, i'm stupidly using "code" as my deeplink string, and the result, it crash my app.

    So, sometime we need to be careful on choosing deeplink string name.
    When you say deeplink, you mean a custom url? because I am not familiar or understand deeplink of "code".
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Well, this event was not added before because:
    1) it receives platform specific parameters, which can usually be interpreted by platform specific plugins
    2) is there really a usage for it inside Gideros Lua environment?

  • 2) is there really a usage for it inside Gideros Lua environment?
    Would a simple YES do or would you want an elaborate long detailed answer that basically just says YES?
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • tkhnomantkhnoman Member
    edited November 2013

    When you say deeplink, you mean a custom url? because I am not familiar or understand deeplink of "code".
    might be that. I'm also not sure what's the name of that... Facebook said it is deeplink.

    something.com/index.php?code=some_string

    That one...
    If you use "code" for facebook, it would crash..


    @ar2rsawseen :
    Sample usage, for example in my app,
    When user post a facebook dialog, other user who click on that post on iOS device would open the app, and get that some_string passed to the app.

    As for mine, i just use it to obtain Custom Map Code.

  • When you say deeplink, you mean a custom url? because I am not familiar or understand deeplink of "code".
    might be that. I'm also not sure what's the name of that... Facebook said it is deeplink.

    something.com/index.php?code=some_string
    OK, that is not a custom URL or atleast not what I was referring to. I was referring to something like
    facebook://ozapps
    or
    gideros://compile_build
    instead of
    http://
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Just for testing purpose, I've attached the file for ios, add it to xcode and you should receive the OPEN_URL event.
    Unfortunately I could not test it, as I'm already away from my Mac.

    You can use it like:
    require "openurl"
     
    openurl:addEventListener(Event.OPEN_URL, function(e)
    	print(e:getType(), e.url)
    end)
    Hope that helps for a start :)
    zip
    zip
    openurlbinder.zip
    1K

    Likes: OZApps

    +1 -1 (+1 / -0 )Share on Facebook
  • OZAppsOZApps Guru
    edited November 2013
    @ar2rsawseen,

    thanks for that, but that is so much more code than I use in Objective-C to handle the openURL and pass the parameter to Gideros (without a plug-in, in a bit of a round about way).

    BTW, I do not have events in Lua, and love the way this one has events, OPEN_URL

    It could help other developers and maybe if it was integrated into the SDK as an event, that would be so nice.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • @ar2rsawseen:
    Tried. Works great, thanks :)
Sign In or Register to comment.