[Solved] Facebook API: How to integrate & test an unpublished app?

I’m using daily build 706 , and I’m working to integrate my game with Facebook. The problem is, I can’t select Native iOS App in the App section of Facebook Developer pages where it requires me to select how my app integrates with Facebook. Unless my game is already published and available, Facebook won’t allow me to select it.

So, instead of Native iOS App, I selected Website and Mobile Web. And then, I used the Post Photo function found in the CoronaSDK > SampleCode > Networking > Facebook folder. Modifying the sample function gave me the wall post that looks exactly like what I want to see. So far, so good.

My plan is to switch the selection in Facebook Developer page from Website and Mobile Web to Native iOS App as soon as my game is approved by Apple (and not change the code from which I build the game and submit to Apple). However, I’m not sure if this is the right way to finalize the FB integration process.

Will there be a big difference in user experience when I switch from Website and Mobile Web to Native iOS App…? Am I going down a bad path? Should I find a way to test my game/code with Native iOS App some how?

I saw Eric’s suggestion on this post about grabbing some valid iTunes app id from Ansca’s showcase, but I have no idea what it means and how to go about doing it…

I’d very much appreciate any insight and suggestion regarding this.

Naomi
[import]uid: 67217 topic_id: 20981 reply_id: 320981[/import]

Hi Naomi,

Put your facebook selection as a Native App. The App ID they are talking about is the unique identifier that’s tied to your application. Without it, facebook won’t be able to tell if it’s your application that’s trying to access the API system.

You can wait to set the App ID until you have it, but I’m not sure if leaving it to the mobile web selection will cause any issues. I’ve used facebook API’s as a native app before publishing and it gave me no problems.

Just be sure you know what your App ID is when you publish.

Hope this helps
-JT [import]uid: 49520 topic_id: 20981 reply_id: 82874[/import]

Thank you so much, James. I appreciate your feedback.

I have three IDs right now:

  1. Facebook generated App ID – I got it from Facebook developer page when I created a new app for my game.

  2. iTunes Connect generated Apple ID and Bundle ID – I got Apple ID and Bundle ID when I integrated In-App Purchase.

When I select the Native iOS App and enter the two IDs (listed in #2 above), Facebook Dev page returns Your iPhone App Store ID is invalid because the iTunes App Store reports your app as being unavailable for iPhone and iPod touch.

I’m assuming Apple ID that I get from iTunes Connect is the iPhone App Store ID that Facebook want me to enter. Am I wrong…?

Thanks again for all your help.

Naomi

Edit: I just got a solution to my dilemma after I conversed with @brad over here. I’ll still have to get a hold of valid IDs and test it out, but I think I can get over this hump!
[import]uid: 67217 topic_id: 20981 reply_id: 82879[/import]

As noted above, I was able to get a hold of valid IDs and test how it goes with Native iOS App selected on Facebook dev page. And what I found is that, between Website and Mobile Web selected vs Native iOS App selected on Facebook dev page, the user experience on my device was exactly the same. The wall post made on my Facebook page was also identical.

So, it appears to me, the kind of integration/implementation I’m doing can easily be tested without valid Apple ID and Bundle ID from already released app, because I can test it simply by selecting Website and Mobile Web (using my existing website as URL). All I have to do is to change the selection on Facebook dev to Native iOS App as soon as the app is approved and released. (If I used IDs from another app that’s already released, I’d still have to make the change anyway.)

Also, when I used another valid Apple ID and Bundle ID, I had to fetch and install ad hoc provisioning profile for this another app before I could build my game again for testing. I don’t know why that was, and I don’t know if it was a strange case that doesn’t apply to the others. That said, if it does require the provisional profiles of already released app, I imagine using someone else’s Apple ID & Bundle ID may not work too well.

Anyhow, long story short, selecting Website and Mobile Web while integrating Facebook, and changing it to Native iOS App later is probably the right solution for me. If you don’t have an access to valid Apple ID & Bundle ID from already released app, you may want to consider the approach I took.

Naomi

EDIT: Single Sign-on feature that is available starting from Build 707 sounds awesome. Way to go, Ansca! And maybe with the new API integration, using someone else’s Apple ID wouldn’t pause a problem that I encountered. It’s just too bad it’s in 707 – I just can’t drop older iOS devices just yet, so I’m sticking with 706 for now. Sad…
[import]uid: 67217 topic_id: 20981 reply_id: 82960[/import]

Naomi,

That’s good to hear. I remember when I was working on an application and they wanted the App ID even if it wasn’t already in the App store. I’m glad they changed it because that sucked for us. Glad to see it worked out for you. I’m gonna use the same thing for myself now, lol.
JT [import]uid: 49520 topic_id: 20981 reply_id: 83027[/import]

I just read a post by @brad.herman here, and I’m guessing the reason why I needed the provisioning profile of the other already published app might’ve been because I entered the Bundle ID of the other app in FB dev page along with its Apple ID. If I kept the Bundle ID of my app and used the already published app’s Apple ID, it might’ve worked just fine. Hope this info will help if/when someone stumbles onto this thread. (That said, I still kind of like the idea of simply using Website and Mobile Web as my selection on FB…)

Naomi [import]uid: 67217 topic_id: 20981 reply_id: 83177[/import]

Edit: I spoke too soon. The issue was nothing to do with my code that implemented the Facebook. The error was originated from the json library. Once the json was properly required in, everything worked without making any changes to the code for it to work the way it did before. (That said, yes, I did change the build.settings as per the blog post instruction.) Cheers!


I’m now using Daily Build 767, and I’m in the process of updating how I integrate Facebook API ( http://blog.anscamobile.com/2011/12/uploading-photos-to-facebook-in-corona/ ).

Unfortunately, the method I used to work out the code for the unpublished game no longer works. It seems like I will need to get a hold of valid Apple ID and Bundle ID from already published app/game to test my code… Sigh.

Naomi [import]uid: 67217 topic_id: 20981 reply_id: 94546[/import]

Can anyone help me , I want to post photo on facebook but NOT with a URL ,
just by passing the data.

I referred a blog http://blog.anscamobile.com/2011/12/uploading-photos-to-facebook-in-corona/

but still am getting a blank screen after I log in .

Please help asap

Thank u
[import]uid: 95790 topic_id: 20981 reply_id: 94754[/import]

@seth.vedangi, have you set up your Facebook developer account and gotten your Facebook App ID? Also, is your app already published? Also, what daily build of Corona are you using?

In my case, I’m working on my first game, and it has not been published yet. I used the method described above in my first post, and using daily build 706, I was able to post an image on Facebook – but the attachment was pointing to a URL like this:
[lua]picture = “http://www.lavamind.com/images/fb_beetlebounce.png”,[/lua]

I am now using daily build 767, and I followed the blog post instruction. I added a jpg file to my project folder. I changed my attachment to replace the picture with:
[lua]source = { baseDir=system.ResourceDirectory, filename=“fb_beetlebounce.jpg”, type=“image” },[/lua]

Oddly enough, when I post it to Facebook, the jpg image does not show up, but instead, it displays another image from the website I specified in Facebook app (which is www.beetlebounce.com ). I’m assuming it is because I set my Facebook App as Website and Mobile Web (not the Native iOS App). My website does have the image that matches perfectly fine with my game, so it is non-issue for me. And… I have an option to add Native iOS App to this Facebook App as soon as my game is published. I’ll then find out if it’s posting the jpg file that I bundle with my game or the image fetched from my website.

I’m not sure if this helped, but I hope this gives you some idea for your next course of action that would eventually lead you to your solution.

Naomi
[import]uid: 67217 topic_id: 20981 reply_id: 94816[/import]

Thanx Naomi , it really helped the problem in my code is the version m using is old , so i will upgrade it to 767 thanx once again :slight_smile:

vedangi :slight_smile: [import]uid: 95790 topic_id: 20981 reply_id: 95064[/import]

@vedangi, I’m glad to hear it helped.

Cheers,
Naomi [import]uid: 67217 topic_id: 20981 reply_id: 95072[/import]

hey Naomi i tested app in 767 , but it redirects me to facebook from safari , i am able to log in but then it shows me the name of app which i entered in my bundle id , but then when i click allow , it shows an error saying :- safari can not open the page because the address is invalid.

and in url i can see :- m.facebook.com/dialog/permissions.request?refid=0 [import]uid: 95790 topic_id: 20981 reply_id: 95091[/import]

Edit: Hey, Vedangi, your problem might be something to do with your build.settings. Have you added CFBundleURLSchemes as instructed on the blog post?

http://blog.anscamobile.com/2011/12/uploading-photos-to-facebook-in-corona/


Hey, Vedangi, have you set up a URL for your game and have you entered the URL in Facebook dev app page? I’ve reverted my game to work with daily build 704 (with iPad Retina support), so I can’t check how mine does now, but if I recall correctly, mine worked fine. There was a hiccup (due to the json issue I noted elsewhere), but as soon as it was fixed, single sign on worked like a charm. And once signed in, it simply post the message without further ado.

I’m sorry I can’t be of much further help. But my gut tells me that your problem might have something to do with your Facebook dev/app setting.

Naomi [import]uid: 67217 topic_id: 20981 reply_id: 95190[/import]

Thanx Naomi ,

yes i have done exactly same as build.settings given in the blog,
Now I can see the Description I attached with my image and the image is showing a blank space, i mean if i upload a small square image i can a black colored image of same size but the image exactly is not visible …

Can you please help me , I am entering Bundle Id of another app
which is already in app store . I want this to work asap

Regarding URL , can you explain how to set up that , because I am too new to this.

Thanx a lot for your help :slight_smile:
[import]uid: 95790 topic_id: 20981 reply_id: 95360[/import]

Hey, Vedangi, I’m wondering what format you use for the image you attach. If it’s PNG, you may want to convert it to JPG. If you read the blog post instruction carefully, you’ll find that there’s a section that talks about possible issue with PNG. Other than that, I’m not sure what else to suggest.

Naomi [import]uid: 67217 topic_id: 20981 reply_id: 95503[/import]

THanx Naomi,

Yes the image i am attaching is JPG , i tried three different images of JPG, different sizes still
not working :frowning: [import]uid: 95790 topic_id: 20981 reply_id: 96217[/import]

Vedangi, it sounds like there’s some problem with your code. You might want to start your own thread, posting your Facebook code and asking for help. Make sure to mention what daily build you are using.

Naomi [import]uid: 67217 topic_id: 20981 reply_id: 96221[/import]

thanx Naomi

i reported a bug but they replied that it can be an image problem so use 32bit image ,
but 32 bit images dont get saved in JPG or PNG

Vedangi :slight_smile: [import]uid: 95790 topic_id: 20981 reply_id: 96231[/import]

Vedangi, to start a new thread:

  1. go to: http://developer.anscamobile.com/forums/Developer-Support

  2. Click on “Post new Forum topic”

If there’s no issue with your code and no issue with your JPG image, I have no idea why it isn’t working for you…

Naomi [import]uid: 67217 topic_id: 20981 reply_id: 96327[/import]

Thanx a lot Naomi :slight_smile: [import]uid: 95790 topic_id: 20981 reply_id: 96492[/import]