Skip to main content
Inspiring
May 9, 2011
Question

StageWebView VS NavigateToURL (the best way to share something on Twitter / Facebook)

  • May 9, 2011
  • 4 replies
  • 1657 views

Hello guys!

I would like to know your thoughs on something.


It's true that we are little more restrained on "social features" compared to the iOS SDK.

But i want at least to share highscores, pictures or links on Twitter / Facebook.

It's the minimum we can expect from a mobile game today!

For that, i tried 2 tests:

- with StageWebView
- with NavigateToURL

The 2 work well, but it's not very ergonomic...

This is the video of the my test:

The test is very simple: i have a score in a textfield, with saved with SharedObject.
And i pass it all through a URL when i push a button.

It's work for Twitter, Facebook and i think all social website!

With StageWebView, i can open the link in the app, so cool!
BUT after that, to close the webview, you have to put button somewhere...
I don't think that Apple will appreciate that... And i can't find a way to stop scrolling!

People can start to explore the web! It would be perfect if we can JUST view a part of the page!

I also noticed a bug if the page is refreshed (when there is a new tweet) everything freezes!

So.... Not bat, but i don't know if can i use that!

For the NavigateToURL, it just opens a new window in Safari... It's working!
So thanks to the new Air 2.6, your app is running behind, but it's not perfect!

Because you have to leave your application!

What you think?
Is there a better way to share somethink?

Thanks!

This topic has been closed for replies.

4 replies

May 9, 2011

Have you been able to add the hash tag (#) or (@) characters  to your twitter status when using navigateToUrl?  In ios when i have tested this I have not been able to.  I use the navigateoturl method for now when wanting to post as well because I don' think stagewebview is very viable yet since you can't interact with it via code

Inspiring
May 9, 2011

Thanks!

And i'm agree with you, that's too bad, but navigateToURL is the best way...!

So for the @ character, let say we have a button called "myTwitter", and we need to pass the link when we click on it:

import (blablabla...)
import (blablabla...)

public class Main extends (blablabla...)

var currentScore:Number

myTwitter.addEventListener( MouseEvent.CLICK, openLink );

function openLink( e:MouseEvent ):void

{

     currentScore = 10;      var reqString:String = 'http://twitter.com/home?status='Blablablabla You win ' + currentScore + ' Points! Follow us @Dooprod';      navigateToURL(new URLRequest(reqString),"_blank");

}

And it should open Twitter with this message:

Blablablabla You win 10 points! Follow us @Dooprod

I Test on iPhone / iPad, it's working!

And for the # character, i didn't find a way yet!
If i have an update, i'll share here!

Participating Frequently
May 1, 2012

Use URL encoding reference for space # @ etc

http://www.w3schools.com/tags/ref_urlencode.asp