GLBasic forum

Codesnippets => Inline / 3rd party => Topic started by: Kitty Hello on 2013-May-02

Title: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: Kitty Hello on 2013-May-02
Hi,

find the attached 2 files. Place the .mm file in your xcode project. Drag it into the "classes" folder in XCode then.
(http://www.glbasic.com/pix/tnsocial_framework_xcode.png) (http://www.glbasic.com/pix/social_framework_xcode.png)

Include the gbas file into your project. Then, first, see if the service is available. If so, do the posting. You can either post text, url or an image.

Tadaaa.

The rotation might not be correct. Pardon me.
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: bigsofty on 2013-May-03
Nice work!  :booze:
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: DaCarSoft on 2013-May-06
Hi.

About rotation/orientation, I replied you (Gernot) here:

http://www.glbasic.com/forum/index.php?topic=7927.msg78589#msg78589 (http://www.glbasic.com/forum/index.php?topic=7927.msg78589#msg78589)
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: bigsofty on 2013-Jun-25
What framework(s) do you need to add to get this working? ("social.framework"?)

Also, I'm getting this error...

Code: GLBasic [Select]
Undefined symbols for architecture armv7:
  "_gpiPhoneViewControllerWithRotation", referenced from:
      -[GLBasicThing intern_post] in social_framework_ios.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Title: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: Kitty Hello on 2013-Jun-26
Social. I can't remember off my mind. But not the olt twitter/facebook ones.
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: bigsofty on 2013-Jul-25
Couple of small problems with this routine...

Code: GLBasic [Select]
//! post
// \return TRUE/FALSE if social framework is available for this platform
FUNCTION SocialFramework_Post%: stype%, text$, url$, img_id_sprite% = -1
        LOCAL rv% = FALSE
        LOCAL img$ = PLATFORMINFO$("TEMP") + "/socialimg.png"
        IF img_id_sprite >=0
                SAVESPRITE img$, img_id_sprite%
        ENDIF

        ?IFDEF IPHONE
                rv% = iosSocialPostMessage(stype, text$, url$, img$);
        ?ELSE
                // we're just doing NETWEBEND :(
                NETWEBEND "http://www.glbasic.com/main.php?site=gack_connect&nonav=1"
                rv = 1
        ?ENDIF

        IF img_id_sprite >=0
                KILLFILE img$
        ENDIF

        RETURN rv%
ENDFUNCTION

Code: GLBasic [Select]
LOCAL img$ = PLATFORMINFO$("TEMP") + "/socialimg.png"

Tries to create an img$ with ..(temp folder)"//socialimg.png" with the latest GLB beta, which it fails at.

Also, if you use img_id_sprite% = -1 then this line again...

Code: GLBasic [Select]
LOCAL img$ = PLATFORMINFO$("TEMP") + "/socialimg.png"

Creates a path to a file that will not be created. SAVESPRITE  is never visited to create it.

And this line will then try to read it...

Code: GLBasic [Select]
rv% = iosSocialPostMessage(stype, text$, url$, img$);

This is the routine patched...

Code: GLBasic [Select]
//! post
// \return TRUE/FALSE if social framework is available for this platform
FUNCTION SocialFramework_Post%: stype%, text$, url$, img_id_sprite% = -1
        LOCAL rv% = FALSE
        LOCAL img$ // "" is OK as it's handled in the ObjC
        IF img_id_sprite >=0
                img$ = PLATFORMINFO$("TEMP") + "socialimg.png"
                SAVESPRITE img$, img_id_sprite%
        ENDIF

        ?IFDEF IPHONE
                rv% = iosSocialPostMessage(stype, text$, url$, img$);
        ?ELSE
                // we're just doing NETWEBEND :(
                NETWEBEND "http://www.glbasic.com/main.php?site=gack_connect&nonav=1"
                rv = 1
        ?ENDIF

        IF img_id_sprite >=0
                KILLFILE img$
        ENDIF

        RETURN rv%
ENDFUNCTION

Unfortunately though it does not solve my problems?  :noggin:
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: Kitty Hello on 2013-Sep-17
@bigsofty: Did you use the V11 beta? It "should" be in there.
Also, clean and rebuild. Make sure you use the correct libGLBasic-egl.a library. Maybe the compile process did not overwrite the one in your project folder after the update. It's in compiler/platform/iPhone/XCode/GLBasic/Lib.
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: bigsofty on 2013-Sep-18
Thanks for the reply Gernot, I solved the problem by only supporting iOS 6+ IIRC in the XCode project settings. Not the best solution I know but I needed it out for a deadline.
Title: Re: Social Framework (Twitter, Facebook) for iOS, iPhone, iPad
Post by: tatakamucher on 2013-Oct-03
how can i use it  :| ? some example pls  :D