reduce Facebook SDK size for iPhone app - iphone

I integrated facebook SDK in my app, the problem is the size of the SDK (around 12mb), is there any way to decrease this size? i'm using facebook feed dialog only...
I tried to remove "Facebook SDK" document file (11+ MB) from the actual Facebook SDK folder, surprisingly i can still use facebook in my app, share items thru feed dialog HOWEVER, i'm getting around 70 warning :S
warning: (armv7) /Users/Desktop/iPhone App/FacebookSDK.framework/FacebookSDK(FBRequest.o) unable to open object filewarning: (armv7)
is there anyway to get rid of these warning OR i have no other option than going with the same facebook SDK size e.g. 12mb
I just tried running app on the simulator, it does not give me any warning however, on my both devices iPhone 4 & 5, it gives me around 70 warnings...

Do one thing , integrate it with your app and then see the size of the app .... and you dont need to add the whole folder to it .... only the Facebook sdk , the rest are the samples from facebook out of which you can use any according to your requirement.
Hope this is what you require ...

Along with just adding only the framework files...When your app is actually archived and a .ipa (iOS application) file is produced you will see a TREMENDOUS drop in file size.
For instance.
I have added
ZXing(barcode scanner)....which is 212mb alone
Parse SDK
Facebook SDK
iCarousel
10 view controllers
Objective-Zip
Even with all this in my application my .ipa is sitting at a little over 4mb. Which is pretty small by todays standards for an iOS app. Installed it was a 6.7mb
The easiest way to tell how bit it is would be to run on a device.
On your iOS device(maybe even the simulator) go to Settings > General > Usage and find it in the list. My bet is you'll be quite shocked as to how small the actual application is when its compiled.
So the main issue left is that your settings and the way you have it setup is the main issue...not the size. I would look into that instead.

Related

Unity iOS build: app store size 4x ipa size

We are facing an issue with our new game download size on the store, we are using :
- Unity 5.0.2
- Xcode 7.0.1 (bitcode disabled)
After building the game with Unity and archiving it in xCode, if we export the archive to ipa ( Save for iOS App Store Deployment , without app symbols), the ipa size is 39.4MB, but when we submit the game to App Store (through xCode organizer directly, or using the Application Loader with the ipa), Testflight shows the game size to be 172.9 MB !!!! which is a huge problem, many players will not download the game because of that.
Any help will be much appreciated.
-Khaled
Testflight usually shows the size including symbols. Therefore it's important to mention that Testflight size != Appstore size. You can of course submit the symbols with your final Appstore submission as well, but this is not encountered for the download size limit. Apple adds some additional files to your submitted ipa but most importantly, it takes the binary and applies security measurements on the text segment which won't be compressed anymore afterwards and could increase the final size.
Anyway, you need to upgrade to a newer Unity Version, as 5.0.2 includes a quite outdated IL2CPP version which improved a lot in the last year. There is a guide on how to receive proper values and also some tips in the Unity forums about it.
http://forum.unity3d.com/threads/il2cpp-build-size-improvements.322079/
I solved this problem! Just move back to xcode 6.4 version! :)

iTunes Lookup API, get iPhone 5 app screenshots

I use iTunes API lookup to get app data by App ID this way:
http://itunes.apple.com/lookup?id=543891460&lang=ru
Even if app is designed for iPhone5, in JSON I get 3.5 inch screenshots (under screenshotUrls array).
Is there any way to get 4 inch. screenshots?
It is possible to access all screenshots using the inofficial iTunes Connect API:
https://itunesconnect.apple.com//WebObjects/iTunesConnect.woa/ra/apps/version/[app_id]
It contains all existing screenshots in all resolution in the original format.
Unfortunately I haven't found a way to map the language with the one used by the iTunes Transporter.
There is a pull request, adding this feature to deliver: https://github.com/KrauseFx/deliver/pull/113/files
Update: a mapping of language codes to languages can be found here: https://github.com/KrauseFx/deliver/blob/master/lib/assets/DeliverLanguageMapping.json
Check again.
Apple seems to be rolling out new 4 inch screenshots since a few hours.
Screenshots now also have the pixel-size in the filename. Well, kind of: it doesn’t seem to be 100% correct (yet?). The possible values are:
xxx.xxxxxxxx.1136x1136-75.jpg (4" iPhone)
xxx.xxxxxxxx.320x480-75.jpg (3.5" iPhone)
xxx.xxxxxxxx.480x480-75.jpg (iPad)

Anyone else having problems installing iPhone Enterprise apps on released IOS 5?

Anyone having problems deploying Enterprise apps on iPhone/iPads running the released version of iOS 5 using the OTA ("over the air") methodology?
During the installation process, we get the alert box: "the app could not be installed at this time". Tapping the Retry button does nothing. In some cases, repeated tapping of the Retry button eventually results in a gray, empty launch icon being left on the home screen. No app installed. No other errors.
Anyone else seeing this or have a resolution?
The below description is a bit involved, but please bear with me as it may help others who run into the situation. I will post the resolution if get a resolution from Apple. So far, no joy there.
Our app refuses to install OTA on iOS 5. This same app WILL install on iPhone/iPad devices running iOS 4.x.x AND the same app will install on iOS 5 devices physically connected to a desktop machine using the iTunes app.
The Apple Developer forums under the IOS 5 Beta category complained about the problem but no indication of resolution as of last week just before the official release of iOS 5.
Cookies are set to be accepted.
Bowser cache and history cleared.
Using mobile safari originally installed with original iOS version 4.x.x.
System hardware and operating system configuration
iPad 2, iPhone 4 or any iPhone device running iOS 5 RELEASED version.
Browser and version
Mobile safari that is installed with iOS 4 on ipad2. Don't know if mobile safari upgrades with ios 5 upgrade.
Using a corporate wifi network. Yes, we are behind a firewall and use a proxy server. Since iOS4 devices install without problems, I don't think installation being blocked by the proxy or firewall.
Enterprise app built with Xcode 4 and ios5 sdk provided with it. Built to be backward compatible with iOS 4.0.
Distribution provisioning profile is correct as we have been using it for several weeks.
This app installs properly on iOS 4 devices both over the air and via iTunes application method.
This app installs properly on ios5 devices through the physical connection with iTunes application on the Mac desktop.
Steps to reproduce:
User types in the URL in mobile safari on iPhone/iPad running ios5.
The resulting webpage shows the download app link.
User taps on the link and is asked if they want to install the app.
User taps the yes, install button.
App proceeds to install.
A gray launch icon shows up on the home screen with the progress bar empty at the bottom of the icon.
Message below the icon indicates "loading".
Seconds later, user gets the "cannot download app at this time" error message as seen in screen shot attached.
Tapping the retry button results in the same action just described.
Tapping done results in the download stopping.
If you tap retry several times, user sometimes is left with the gray empty launch icon, which will not launch and cannot be deleted.
Note: In the apple developer forums, under the iOS 5 beta category, people are describing the exact same problem with no resolution.
Had the same problem, and was able to resolve it. However, the error noted is not specific to a single cause that handles every case... some detailed investigation needs to occur.
Your best bet is to connect the device to your Mac, and using the Organizer of xCode view the console logs while you are attempting to do a wireless deployment. There will be some useful information available -- please post the logs.
For my case -- the icon files were missing from the build, as a result of moving from xCode3 to xCode4 and also, the distribution plist was referencing an image that returned a 404. Both were logged in the console, but not very clearly.
Also, as a sanity check, manually verify the URL to your IPA file also.
I had this same problem and was sure everything was correct in my project; but restarting Xcode and doing a clean revealed my Enterprise scheme had somehow defaulted to the wrong provisioning profile.
Re-selecting the correct profile and re-archiving the app fixed the issue for me, I'm able to install an enterprise app on both iOS4 and 5.
I wanted to chime in after fighting this for a few hours. It is iOS 5 specific.
We had an htaccess password protection on the directory. Removing this allowed the app to finally download. So if you have htaccess, perhaps you can point the user to a parent directory that is password protected, then navigate to the subdirectory containing the app that isn't password protected. This is a temporary solution, apple needs to fix this.
Another thing to consider is the URL you specified in your over-the-air Application.plist file. I received the same error message ("-application- could not be installed at this time") because the URL I specified was too unspecific. Rather than writing "directory/directory/application.ipa", I had written "directory/directory/". You must include your application in the complete URL of the plist file's configuration.
If you didn't do this, don't fret! You don't have to rebuild the entire thing from step one, you can open your .plist file in any standard text editor and simply change the URL.
We had the same thing.
Our mistake was to point to a wrong 512.png icon in the manifest.
Which was no problem on iOS4 but turned out to stop iOS5 into a "...at this time" alert.
Wanted to chime in on my experience.
In my case, we were changing the address where the IPA file was hosted. Although I updated the PLIST file with the proper URL to the IPA file, iOS was still going after the old URL almost as if it cached the PLIST data. Creating a copy of the PLIST file and renaming it resolved the issue (data within the file remained unchanged)
I met the same problem today. The app can be installed in ios4, but failed in ios5 with "** could not be installed at this time" alert.
According to patricksan's suggestion, I download iPhone Configuration Utility 3.5 for Mac OS X, and try to catch the log while install the app through OTA.
The log helped me finally, one sentence of the log says entitlement 'get-task-allow' has value not permitted by a provisioning profile. It remind me that if the code signing identity in build settings of Project and Targets are correct, after checking them in Xcode, I found the code signing identity are not correct one, they should be iPhone distribution:.... other than iPhone developer:..... After correcting them, and re-Archiving the ipa file, it can be installed in iOS 5 now.
Check your Info.plist for Required device capabilities property. I recommend to delete completely this property if you haven't any restrictions on use.

Can an iPhone Web App use the Camera?

I have a web app and I want to take photos and then upload them to a server. Can this be done with a webapp?
[edit] It's now possible, please see answers below.
No, webapp cannot access internal devices.
Try PhoneGap to make the gap between your app and the internal devices. But that will compile an application, which need to be distrubuted via the Apple Store.
This is now possible with iOS 6 and HTML5.
Using the <input> tag, you can get file input from either the camera or gallery (the familiar "take photo or video, choose existing"). Try:
<input type="file">
this will pull up the aforementioned dialog box of options. You can also add the accept attribute to specify whether you want image or video, like so:
<input type=file accept="image/*">
Max Firtman has a great article about what you can do with iOS 6 and HTML5 here: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
You'll be able to create 'provisioning profiles' for up to 100 different devices to directly install your apps on, without going through the App Store. The install process isn't as straightforward as calling up a URL or downloading something from the App Store, but at least you can limit distribution to specific people without revealing the existence of the app in the public App Store.
Also see iPhone App Minus App Store?

Pre-release checklist before building final version for App Store

Curious what practices people have learned before making their final build and submitting to the App Store? Aside from switching from Debug to Release & commenting out calls to NSLog what other basic and/or not so basic things should we be watching out for?
This is a good question and I'd like to restate some of the answers and add a few of my own. I've made this answer Community Wiki, feel free to add to it.
Delete the app from your device, turn off WiFi, off cellular data, now install and test app. Does it work properly (as much as it can without Internet)? Does it at least tell the user that a network connection is required (if it is) or does it crash?
If you use CLLocationManager: Delete the app, fresh install and run, but do not allow app to have Location Data. Does the app behave well or does it crash? Does it at least tell the user that it can't run without location data (if that is a requirement)? Does it work on an iPod Touch that does all geo location using WiFi only?
Run the app in the simulator and for each view controller do the following steps: (a) From the iPhone Simulator menu select "Hardware" --> "Simulate Memory Warning", (b) now navigate around your app to other view controllers and see if everything is working, (c) repeat test for another view controller.
If you support older firmware (ie: iOS 3.1.3), install your app on a device running 3.1.3 and test it there (if you don't have one, use the 3.2 simulator).
Start your app while on a phone call or when Personal Hotspot is active. Are all the screen layouts correct (the status bar is 40px high instead of 20)? Did the bottom 20px of the view get pushed off the screen or did it resize correctly?
Accept a phone call while in your app, does it resign active and resume properly? Do sounds from your app stop playing while in the phone call?
Start your app while playing music, does the music continue to play? Do your sounds mix properly or fade the music appropriately?
Test performance on a slower devices with limited RAM such as: iPhone 3G (128MB RAM, 412Mhz CPU) or iPod Touch (1st or 2nd gen).
Run the Clang static analyzer and fix (or at least understand) every warning.
Make sure NSZombiesEnabled is NO in the environment variables (caution: not sure if this is still a problem)
A few things:
I actually recommend not creating a build configuration called "Distribution" as Apple specifies, because I often am creating ad hoc builds for beta testers. I create two build configurations, one called Ad Hoc and one called AppStore, so I'm not confused. The only difference between the two is the presence of the Entitlements.plist file for the Ad Hoc build. This way I can test as closely as possible what I will be submitting to Apple.
Most developers are optimists. That's why we are working weekends to create an app that we just know is going to make us a millionaire. Before submitting though, be a pessimist. Imagine everything that can possibly go wrong, and double check it.
Don't assume anything. Don't assume that that tiny little change you made to the app won't affect anything else. Murphy's Law says that that tiny change will cause your app to crash on all iPod Touches or something. Test, test, test thoroughly between the final code edit and Appstore submission. If you have to make a tiny change, then repeat until it's perfect.
Remember that if the app doesn't crash for 99.9% of your users, then 1 out of every 1,000 downloads will result in a 1-star scathing review.
I use Clang static analyzer, Leaks and Object Allocations during development, but I do an extra run of these tools before submission just in case.
If you don't have an older device, get one, because the 3GS performance is significantly better and you may miss some important performance issues.
Test your app with the following configurations when network or location are applicable:
iPod Touch
iPhone 3G
iPhone 3GS
iPhone in Airplane mode
iPhone with Wi-Fi
iPhone with EDGE
Call the phone while using your app
Instead of switching to Release, I switch to "Distribution". It's a copy of Release, but that's is how I got taught by some Apple doc and iPhoneDeveloperTips.
Important points:
After the final build, but before you rush off to zip up your app, open the bundle using the Finder's Show Package Contents. Due to some bug in the MacOS, which bit me in versions prior to Snow Leopard (and it might still be there), if you zip up too fast (using the Finder's Compress or Archive menu item), some of the resources have yet to be flushed out into the file. When you do a Show Package Contents, the contents get updated. The way you would notice this problem is that the size of your compressed app would be between a fifth to a tenth or less of the expected size. You might think to yourself, "hey, that zip utility really does a great job of compressing", but that's not the case. This problem would occur at this point instead of during testing mainly because you are doing a "clean all" build and all the resources and contents of the app bundle are starting out empty and then being filled by Xcode. And for some reason, even after Xcode is done creating the file, the contents are still not actually there, if you compress, but would be there if you looked at them (sort of a reverse Heisenberg). Beware.
Another area I spend a lot of time on is to make a nice backup of the sources, after I have committed all the latest changes to SVN, made a new branch, and tagged the file. I also like to have my version number match my SVN build/commit number so I always know which SVN version matches my release. I have those two version numbers in my info.plist and can be pulled up by the app user when they hit i for info. For example, a current info.pist includes:
<key>CFBundleShortVersionString</key>
<string>2.0a1</string>
<key>CFBundleVersion</key>
<string>346</string>
There are different thoughts on how to use the CFBundleVersion. This is my way. Also useful is the command line utility, agvtool.
Once the app is built, after compressing so you're not actually making any changes to the compressed version, go check the app file and make sure it is signed with the right distribution cert and not your adhoc one. Learning to use the command line utility, codesign, is helpful for this kind of checking and debugging. By making the compressed copy first, you ensure that you're not in any way going to change the final copy that Xcode has handed you and that you will upload to itunesconnect, if all looks well.
Other things to remember are the app icon, the various other icons and graphics you need for the iTunes store, the info.plist, and the fact that when the uploading of the app fails with a cryptic error message, it usually has to do with one of these pieces being missing from the compressed file you are building (those pieces that belong in the app bundle).
Look into this check list document # Github
https://github.com/bapu/AppReleaseCheckList