Social Framework (Twitter, Facebook) for iOS, iPhone, iPad

Previous topic - Next topic

Kitty Hello

Hi,

find the attached 2 files. Place the .mm file in your xcode project. Drag it into the "classes" folder in XCode then.


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.

bigsofty

Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

DaCarSoft

"Si quieres resultados distintos... no hagas siempre lo mismo" - Albert Einstein.

bigsofty

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)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kitty Hello

Social. I can't remember off my mind. But not the olt twitter/facebook ones.

bigsofty

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:
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kitty Hello

@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.

bigsofty

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.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

tatakamucher