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.
Nice work! :booze:
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)
What framework(s) do you need to add to get this working? ("social.framework"?)
Also, I'm getting this error...
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)
Social. I can't remember off my mind. But not the olt twitter/facebook ones.
Couple of small problems with this routine...
//! 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
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...
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...
rv% = iosSocialPostMessage(stype, text$, url$, img$);
This is the routine patched...
//! 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:
@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.
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.
how can i use it :| ? some example pls :D