Facebook Issues

Hey,

I have a few questions regarding Facebook integration, this is something I have never done before.   Apologies for the slightly long post. 

Firstly does it take a while for the appID to be available from iTunes Connect? I have created an app with iTunes Connect but I still get the error message “We were unable to retrieve your iPhone Store ID from the iTunes App Store. Please double-check your ID and try again later.” when I try and include it in FB (I am assuming it is the “Apple ID” under identifiers in iTunes Connect?).  I have read that you can just use 0, but this doesn’t work either - on another page it states “You may enter ‘‘0’’ if you do not support an iPhone version. If you want to test deep linking before you publish your app, you can temporarily enter a valid App Store ID for an existing app in the App Store.”.  Am I missing something or it is just a waiting game?

Second, I tried to build the included Facebook and Scrumptious apps for the xCode simulator and I am getting the following error - I have changed the appID to that supplied by FB.  Am I missing something?

"  <Warning>: Runtime error module ‘facebook’ not found:resource (facebook.lu) does not exist in archive

        no field package.preload[‘facebook’]

        no file ‘/Users/cbriggsnz/Library/Application Support/iPhone Simulator/7.0.3/Applications/E8ACDFCB-3AF8-49EA-BE2E-1DC643AF7E22/223.app/facebook.lua’

        no file ‘/Users/cbriggsnz/Library/Application Support/iPhone Simulator/7.0.3/Applications/E8ACDFCB-3AF8-49EA-BE2E-1DC643AF7E22/223.app/facebook.lua’

        no file ‘./facebook.so’

        no file '/Users/cbriggsnz/Library/Application Support/iPhone Simulator/7.0.3/Applications/E8ACDFCB-3AF8-49EA-BE2E-1DC643AF7E22/223.app/facebook.so’facebook

"

Edit : 

Sorry,  Corona Build 2183

xCode v5.0.2

Thanks in advance,

Craig

Hi.  I may not be understanding your questions, but let me try to answer anyways.   Also, if anyone has a better answer, please add it.  

  1. You are trying to provide a link to your app on the iTunes store before publishing it?  As far as I know, that won’t work.

On my past projects, we had to either publish the app first, then do an update adding ‘rating’ and ‘app linking’ stuff. i.e. Anything that needed to link to the app page came in the update.  Very painful and counter-intuitive.  

or , we had to ask Apple to tell us what the link would be in advance so we could include it.  (No I don’t know who to ask, the folks I worked for handled that conversation.)

  1. As far as I know, the FB app won’t do anything on the simulator, but needs to be run on the device.  I have found FaceBook to be tricky to set up.  One of the things I ran into was the build.settings file.  I am including a trimmed down version of mine below in the hopes it will help you.  

  2. You didn’t include any information about what version of Corona you’re using, what OS  your running the simulator on, etc.  Please always include the basics when asking for help so folks know what to try to replicate the issue.

    – For more details on this file and what you can do with it, look here: – https://docs.coronalabs.com/guide/distribution/buildSettings/index.html – Find more permissions here: http://developer.android.com/reference/android/Manifest.permission.html – CONFIGURE SOCIAL SETTINGS HERE – CONFIGURE SOCIAL SETTINGS HERE local FacebookAppID = “222222222222” – CONFIGURE SOCIAL SETTINGS HERE – CONFIGURE SOCIAL SETTINGS HERE settings = { plugins = { – -- Social – [“CoronaProvider.native.popup.social”] = { publisherId = “com.coronalabs”, }, }, orientation = { --default = “portrait”, --supported = { “portrait”, “portraitUpsideDown” }, default = “landscapeLeft”, supported = { “landscapeRight”, “landscapeLeft” }, }, android = { FacebookAppID = FacebookAppID, --versionCode = “48”, largeHeap = true, usesPermissions = { “android.permission.WRITE_EXTERNAL_STORAGE”, “android.permission.INTERNET”, – Find more permissions here: http://developer.android.com/reference/android/Manifest.permission.html }, usesFeatures = { – Find more features here: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#features-reference } }, iphone = { plist = { FacebookAppID = FacebookAppID, CFBundleURLTypes = { { CFBundleURLSchemes = { “fb” … FacebookAppID, }, } }, }, }, }

PS - I don’t think the social plugin is necessary for FB, but I always include it because I add Twitter, e-mail, etc. too.

Thanks,  runs fine on the device (guess I should have tried that first)…    

Thanks for the prompt reply…

Craig

You can create links for your app before it is published.  The link won’t work until the app is published, but the link format is documented:

https://developer.apple.com/library/ios/qa/qa1633/_index.html

There are also methods within Corona do this:

http://docs.coronalabs.com/api/library/native/showPopup.html

As for testing your Facebook integration before your app goes live, you have to use a published app’s Facebook ID.  Everything else is configured with your code.  Then before you build your app for release in the app stores, you plug your Facebook app ID back in.

Oh, and as for your Facebook errors, note that Facebook integration recently changed for iOS, where it is now configured as a plugin.  You need to make sure you have updated that if you are using a recent daily build.

I forget where it was documented, and it has not been documented everywhere yet, but if you are using build 2165 or later, then you need to make the change.  See the note here in “iOS Process”:

http://coronalabs.com/blog/2013/07/30/understanding-facebook-authentication/

Hey thegdog - Thank you for your assistance but I’ve heard the same kind of answer on half a dozen different forums concerning the iPhone Store ID.

My app was under review and not yet in the app store. I then discovered that the Facebook integration in my app was not working. So I entered my Apple ID in the fields but I keep getting the same message. I entered “0” but the Facebook integration still did not work. Then I read that I can use a published app’s Facebook ID. 1) This makes no sense to me - use a published IOS app’s Facebook ID for my own iPhone Store ID? and 2) where and how am I supposed to get someone else’s ID. This whole exercise has taken me hours with still no resolution. It’s been the most fustrating exercise I have ever encountered. I had no choice but to re-submit my app without the Facebook integration, wait until Apple approves the app (in about a week or so), then re-enable the Facebook integration, and then re-submit the app … again. Am I missing something here or are Apple and/or Facebook deliberately trying to make it so difficult? Is this what I can look forward to with every app I try to publish with Facebook integration?

Help, please Help.

@eddierush,

See this guide here:

http://docs.coronalabs.com/guide/social/setupFacebook/index.html

Basically, you need to use a published app id for the iPhone App Store ID and/or iPad App Store ID fields if you don’t have one yet.  Once you have your app id, you change it in the Facebook developer portal.  This is just to allow you to get the Facebook side of things working so you can test your app before it is submitted.

If it doesn’t work at this point, there is a problem with your code you need to address.  If the code is working, then you can submit your app.  Your app IDs will appear in iTunes Connect and you can update the Facebook developer portal with the information.
 

You don’t actually need to use a published apps id, you can setup a new app in Facebook, and as long as you use the Facebook app ID it provides you, it can be tested. I’ve been testing my latest app this way for both android and ios. You need to enter the package name, but store ID can be done once you publish otherwise it won’t find it.

Just make sure you have the Facebook app id in your build settings file, and the plugin requested.

@gazjm, as I recall, the Facebook developer portal would not generate a Facebook ID for your app unless you entered in an app ID from iTunes. 

If you didn’t enter an app ID that was already released (it would check with iTunes), Facebook would generate an error and not create the Facebook ID for you… or would but not propagate it, so you couldn’t test.  Can’t remember the specifics.

If they changed that, that is great, and should take care of this confusing step.

They must have changed it, when you create an app, it gives you the Facebook id straight away, you then select what platforms you want to use with the Facebook app I’d which is where you then enter your app info, as long as it’s in build settings and your package name is in Facebook seems to be working.

Hi All - Thanks for the replies.

  • Yes. I have a Facebook ID for the app.

  • The code that is being used for the working Android implementation is the same code used for the IOS implementation. In fact the Facebook portion of the code is based on an existing library that has worked (IOS and Andriod) for many other people. So I trust the code.

  • Believe me, I have searched, visited, read, and followed every post, thread, article, guide that even remotely addressed this particular issue. They all say about the same thing. And the one frustrating theme I see in most of them is, “… use a published app id for the  iPhone App Store ID  and/or  iPad App Store ID  fields if you don’t have one yet …”. What published app id? Is there some site, page, or setting that I go to find the ID of someone else’s published app id. For example, how do I discover the iPhone Store ID for Angry Birds? I feel like I’m being told to find the Holy Grail but no one is giving any clue as to how or where to look.

I know that it has to be something really small that I am missing … so small that the solution may be sitting right under my nose and I simply can not see it.

Please Enlighten Me. I’m in the dark here :slight_smile:

The app id for an app is the number part of the itunes link. But it isn’t needed, I can assure you. All I have in is the com.xxxxxxx.xxxxx identifier and it’s working fine. but if you want to try with an app id just grab an itunes link for an app.

Thank You, Thank You gazjm! Everyone says that I should need it but for the life of me, my tests still fail. So please allow me to ask this question - what do (or did) you do to test the Facebook implementation in your IOS app? I tried several times to test it and it failed everytime:

  1. After I made changes in the Facebook Portal I created another Distribution build from the Corona SDK simulator (using 2014.2186)

  2. I removed the older version from my iPhone 4s using iTunes and synced.

  3. I dragged and dropped the newer app into iTunes and synced my iPhone thus putting the newer app on the phone

  4. I played the game until the appropriate point and I touched the Facebook button

  5. A Facebook alert appears and I touch the OK button.

  6. A half a moment later the Alert goes away and I am back to my game with no further activity.

Am I missing something in my steps?

BTW - I hate the XCode simulator. It takes “ages” before it starts up. Sometimes my app does not appear in the Xcode simulator. Most of the time my app does not work as expected (buttons and animation that don’t work in the Xcode simulator work just fine in the Corona simulator AND my devices - iPhone 4s, iPhone 5c, iPad 2)

Your help is greatly appreciated. Thanks

No probs, in my app I’m posting a message to the wall stating the users score and showing an image hosted on a webserver. I’m not able to access my code at the moment but tomorrow I will post what I have.

For uploading the app to the phone I use the Xcode organiser, it avoids syncing etc in itunes, you can just upload direct.

Hi.  I may not be understanding your questions, but let me try to answer anyways.   Also, if anyone has a better answer, please add it.  

  1. You are trying to provide a link to your app on the iTunes store before publishing it?  As far as I know, that won’t work.

On my past projects, we had to either publish the app first, then do an update adding ‘rating’ and ‘app linking’ stuff. i.e. Anything that needed to link to the app page came in the update.  Very painful and counter-intuitive.  

or , we had to ask Apple to tell us what the link would be in advance so we could include it.  (No I don’t know who to ask, the folks I worked for handled that conversation.)

  1. As far as I know, the FB app won’t do anything on the simulator, but needs to be run on the device.  I have found FaceBook to be tricky to set up.  One of the things I ran into was the build.settings file.  I am including a trimmed down version of mine below in the hopes it will help you.  

  2. You didn’t include any information about what version of Corona you’re using, what OS  your running the simulator on, etc.  Please always include the basics when asking for help so folks know what to try to replicate the issue.

    – For more details on this file and what you can do with it, look here: – https://docs.coronalabs.com/guide/distribution/buildSettings/index.html – Find more permissions here: http://developer.android.com/reference/android/Manifest.permission.html – CONFIGURE SOCIAL SETTINGS HERE – CONFIGURE SOCIAL SETTINGS HERE local FacebookAppID = “222222222222” – CONFIGURE SOCIAL SETTINGS HERE – CONFIGURE SOCIAL SETTINGS HERE settings = { plugins = { – -- Social – [“CoronaProvider.native.popup.social”] = { publisherId = “com.coronalabs”, }, }, orientation = { --default = “portrait”, --supported = { “portrait”, “portraitUpsideDown” }, default = “landscapeLeft”, supported = { “landscapeRight”, “landscapeLeft” }, }, android = { FacebookAppID = FacebookAppID, --versionCode = “48”, largeHeap = true, usesPermissions = { “android.permission.WRITE_EXTERNAL_STORAGE”, “android.permission.INTERNET”, – Find more permissions here: http://developer.android.com/reference/android/Manifest.permission.html }, usesFeatures = { – Find more features here: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#features-reference } }, iphone = { plist = { FacebookAppID = FacebookAppID, CFBundleURLTypes = { { CFBundleURLSchemes = { “fb” … FacebookAppID, }, } }, }, }, }

PS - I don’t think the social plugin is necessary for FB, but I always include it because I add Twitter, e-mail, etc. too.

Thanks,  runs fine on the device (guess I should have tried that first)…    

Thanks for the prompt reply…

Craig

You can create links for your app before it is published.  The link won’t work until the app is published, but the link format is documented:

https://developer.apple.com/library/ios/qa/qa1633/_index.html

There are also methods within Corona do this:

http://docs.coronalabs.com/api/library/native/showPopup.html