com.facebook.sdk error 2 in distribution - objective-c

I already had this working in older versions of my app but our newest update shows this error: com.facebook.sdk error 2 when logging in to facebook.
The app works fine in the simulator and device when built in development mode but the error only shows up when its in the App Store and built in distribution mode. I already found tons of information on the internet but thats not working.
I've checked:
sandbox mode is disabled
bundle id is correct
app store id is correct
facebook logging and deep linking are enabled?
Again our older version worked fine in distribution mode. Our newest version of our app uses facebook sdk 3.5.
EDIT
I unlinked facebook on my device and found out that it returns the wrong app! When pressing the login button safari opens up ask the user for permissions then returns to another app I made (practically the same app but made for a different company). So I deleted all apps on my device and the error was gone.
Double checked the app id on developers.facebook.com and the fbid in my code and thats all correct.
Why is my app returning a different app after giving permissions?

For some reason my phone was mixing up my apps. Uninstalled all and reinstalled and everything worked out fine.

Related

Testing Mac App Store app on real device - How to export?

I have been developing Mac App Store and iOS apps for several years now. I don't event want to know how many hours, days or weeks (?) I spend by solving provisioning problems...
One of my Mac apps targets OS X 10.7+. While everything works fine in genereal, after the last update some users reported problems when using the app on 10.7. Other OS X version work fine.
In the past, I simply cloned the project from my developing computer (iMac) to my MacBook running the specific OS X version. I then opened the project in Xcode, ran it and check what the problem was. This is far to easy for Apple, since this not possible any more.
The project only compiles (due to several reasons) in Xcode 7+ only. Xcode 7 runs on 10.10+, thus testing on 10.7 is not possible.
I have been trying to build/export the app to test it on my MacBook the whole day without any success. The app simply does not start on 10.7 on my MacBook. Of course the MacBook is a registered devices, included in my provisioning profiles, etc.
This is my workflow:
Removed all App Store specific entitlements from the app in Xcode/Target/Capabilities
Created new wildcard certificates and provisioning profiles that does not include any App Store specific entitlements
Selected the new profiles in Xcode/Target/Build Settings/Code Signing
Run Product/Archive
In Organizer select the Archive and click on Export
Here I tried several different combination (signing, no signing, etc.). No matter if I choose Export a Developer-Signed Application or Export as a Mac Application the result is always the same.
When I copy the created App file to my MacBook und start it nothing happens. The icon flashes once and this is all. Only the Console gives I hint about the Problem:
killed com.mycompany.myapp because its use of the com.apple.developer.team-identifier entitlement is not allowed.
Great... As explained I removed all entitlement from the app and from the profiles. Where the hack does this entitlement come from and how do I get rid of it?
Is there no way to test the App with all its features (== all entitlement) on another device?
I should have answered my own question earlier. Back in January I was somehow able to get the app running on my other Mac. Now I had to solve the same problem and it took some time to dig out the correct solution again.
So, maybe this will help others to solve the same problem. At least it will help my future-me to remember what has to be done :-)
Archive the app just as you would prepare the app to be submitted to the App Store.
Switch to the Organizer and select the just created archive
Select Export... instead of Upload to App Store...
Select Export a Developer ID-signed Application(second option). DO NOT select Export a Development-signed Application (third option). Actually I have no idea what's the difference is, but only the first one works...)
Click Next and the Organzier will fetch provisioning information from your dev account. DO NOT select the fetched provisioning profile but select Use local signing assets from the dropdown box instead
Click Choose and Export in the next step.
Done
Good luck and happy app signing...

iTunes Connect Testflight Internal Testers

Downloading beta app from testflight app gives error at the end, says "Unable to download app at this time" on all my devices.
No error is in itune connect upload. App displayed and received notification on adding new app to testflight beta. But everytime same error.
This happened to me when I wasn't using the correct provisioning profile. Very frustrating error that doesn't provide any useful info, and leaves the previous installed version of your test build in a state where it cannot be launched. After I switched my provisioning profile to 'Automatic', bumped the build number, and submitted a new version to iTunes connect I was able to download the new build.
I'm seeing a similar error. I don't know for sure, but I suspect doing things in this order may have something to do with it (this seems to mirror what emrys57 is facing).
You have issued a previous TestFlight release (download/install was working).
You then submitted that version for formal review for publication in the App Store.
While the app submission is still under review, now you uploaded a new TestFlight build with an updated version number (but did not resubmit for App Store review).
It could be that while the app is under review something prevents the download. I seem to recall reading about something like this in one of the guides, but I can't remember where off the top of my head. In my case, as an internal tester I even face the error "Unable to download app at this time", regardless of whether I already have a previous version with the same bundle ID already installed or if I don't have the app already installed (i.e., it's fully uninstalled). I wonder if an accepted App Store review will clear up the issue; it doesn't seem like a good idea to resubmit that latest build for further App Store review if the version previously submitted is what you actually want released.
In my case, for the general testing audience, I have a separate bundle ID that is exclusively for beta testing. And that version is never submitted for App Store review (the one that's slated for App Store review I only use for the purpose of smoketesting the upgrade process with internal testers). That bundle ID for beta had to go through the one-time full TestFlight external review for the initial TestFlight external beta testing. But I've been able to keep adding new versions to that beta-only bundle ID for subsequent TestFlight releases without an issue.

Mac App distribution Invalid Binary issue

I am trying to upload my mac xcode project on mac app store, but each-time it shows invalid binary status. I have checked many answers in stack overflow as well. But issue is not resolved. That's why I am posting new question here
I tried some options -
1.. Removed all warnings
2.. Checked by quiting xcode, cleaned container folder
3.. provisioning profile is valid, and matching to the bundle id. I checked by deleting all certificates and provisioning and install required ones again.
4.. Created new provisioning profile and certificate 3 times. But same issue
5.. uploaded 3 times directly through xcode 5.1.1, and 2 times by Application Loader. But showing Invalid binary for all.
6.. App is properly sandboxed with proper permissions
Any idea. Thanks in advance.
Invalid Binary
When you get this error, apple will send you a mail with reason. In my case this was the email:
Dear developer,
We have discovered one or more issues with your recent delivery for
"App-Name". To process your delivery, the following issues must be
corrected:
App sandbox not enabled - The following executables must include the
"com.apple.security.app-sandbox" entitlement with a Boolean value of
true in the entitlements property list. Refer to the App Sandbox page
for more information on sandboxing your app.
App-name Mac.app/Contents/MacOS/app-name
Once these issues have been corrected, you can then redeliver the
corrected binary.
Regards,
The App Store team
Also, you shouldn't be using XCode 5.1.1 itunes connect has changed a lot now.
Please update to 6.0.1 or use the new beta version 6.1
Xcode 6.1 GM seed for OS X Yosemite
hope this helps

Using Worklight JSONStore

I am not that new to Worklight, but the JSONStore is a new feature and I'm trying to learn how to use it. I downloaded the sample app (module_07_10_Using_JSONStore.zip) and installed it in my development environment, ran build and deployed it.
When I preview the app (as Android) in the Mobile Browser Simulator, and run through the sequence of Initialize the Collection, Add a Document, and then try to Find by Name, Find All, or get Number of Documents in Collection - I do not see the table at the bottom of the screen that displays the input data. I don't see any errors in the WL console. In the Android console, I get the error messages:
Unable to resolve target 'android-8'
WARNING: unable to write jarlist cache file - and then it points to location of jarlist.cache in the module.
I did not make any changes to the code. I looked it over, compared it to the education module content, and I don't see the problem. Any thoughts? Clues? Your help is appreciated. Thanks.
JSONStore is not supported in the Mobile Browser Simulator, it must run on an Android or iOS device or simulator, if you run it on the Android simulator it should work just fine.

iAds not showing on developer device

On the device I developed my app on, I saw the "test ad" screen on my app before I submitted to the app store. Then I deleted the version of my app that was installed by XCode and downloaded the app once it was approved by Apple via the App store. Now in my newly downloaded app, I STILL see the "test ad" banner. Is there any way to see the real banner on my development device? I am just curious what types of ads my users are seeing.
Try deleting the app and reinstalling it from XCode. That fixed this problem for me.