GLBasic forum

Main forum => GLBasic - en => Topic started by: Kitty Hello on 2010-Nov-16

Title: iPhone URL schemes
Post by: Kitty Hello on 2010-Nov-16
http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html (http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html)

I'll implement that as the GETCOMMANDLINE$() in the next version, OK?
Title: Re: iPhone URL schemes
Post by: bigsofty on 2010-Nov-17
Handy!  :good:
Title: Re: iPhone URL schemes
Post by: Hark0 on 2012-Apr-16
Hi!

About GETCOMMANDLINE$() on iOS.... any changes/implementation for "Open with...."?

Last comment on log_e.gbas as:

// 8.174

// iOS:
//    - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
//    -> url will be what you get with GETCOMMANDLINE$()

:P
Title: Re: iPhone URL schemes
Post by: Hark0 on 2012-Apr-16
I  made this code for "trap" files...

Code (glbasic) Select


//----------------------------------------------------------------- WRAPPER DRAG & DROP - SOPORTE IOS

        GLOBAL commandline$ = GETCOMMANDLINE$()
        GLOBAL Trap$=RIGHT$(commandline$,3)

        IF Trap$="ERM"
            LOCAL Path_Origen$=""
            LOCAL Fichero_Importar$=""
            LOCAL Control=LEN(commandline$)
            LOCAL Resto=0
            LOCAL Caracter$=""

            WHILE Control<>0
                Caracter$=MID$(commandline$,Control,1)

                IF Caracter$=CHR$(92)    // -> Carácter \
                    Resto=Control
                    Control=0
                ELSE
                    Fichero_Importar$=Caracter$+Fichero_Importar$
                    Control=Control-1
                ENDIF
            WEND

            Control=Resto

            WHILE Control<>0
                Caracter$=MID$(commandline$,Control,1)

                IF Caracter$=CHR$(32)    // -> Carácter ESPACIO
                    Control=0
                ELSE
                    Path_Origen$=Caracter$+Path_Origen$
                    Control=Control-1
                ENDIF
            WEND


            PRINT "*"+commandline$+"*",0,0
            PRINT "*"+Path_Origen$+"*",0,15
            PRINT "*"+PATH_INBOX$+"*",0,30
            PRINT "*"+Fichero_Importar$+"*",0,45


            COPYFILE Path_Origen$+Fichero_Importar$,PATH_INBOX$+Fichero_Importar$
            //KILLFILE

            SHOWSCREEN
            MOUSEWAIT
        ENDIF

//----------------------------------------------------------------- WRAPPER DRAG & DROP - SOPORTE IOS


On win32 works perfectly... detects and copy the file (extension ERM) dropped to //documents/inbox folder

I test this later on iOS...

:)