I'm working in a new iOS app and I noticed the following issue installing the app in iOS7 environment.
After opening the app by first time, our app displays a popup with the AGB's that needs to be accepted in order to start using it.
We used a UIAlertView and it worked fine until we tested with iOS7. Actually the alert pops up and seems to have content since I can see a huge scrollbar! But the strange thing is that the text is not shown at all.... After playing a bit with the text I noticed that the new UIAlertView of iOS7 has some kind of string length limit...
Has anybody else noticed that? Is this normal, or an iOS 7 bug?
I found that custom UIAlertView works, but I would rather use a native API if possible.
I can confirm what you say. post a radar maybe -- there is no reason for this.
for(int i = 0; i < 10000; i++) {
longTextVar = [longTextVar stringByAppendingFormat:#"%d", i];
}
UIAlertView *alert = [[UIAlertView alloc]initWithTitle: #"agb" message: longTextVar delegate: self cancelButtonTitle:#"ok" otherButtonTitles:nil];
breaks it, while 1000 appends work
I encountered with the same UIAlertView problem, where in the simulator the scrollview was big enough to hold the long text but text was not there. After I tried the show same lenght message on iphone alertview did show the message.
Therefore, I think this is a simulator issue, not really a limitation, and that is why it is not documented.
Related
I'm developing a lockscreen application using theos and part of the functionality requires icon images of certain applications on the phone. How can I go about getting those icon images and displaying them on the lockscreen of the phone?
I've tried everything I could think of so far and have searched through the springboard headers with no luck. I've specifically been trying retrieving the images from SBApplication and SBIconModel from suggestions I found through google, but still I have no luck.
Any help is greatly appreciated. Thanks!
After you %hook a class, inside the method you're using, do the following if for example you're trying to get the icon for the mail app
// Get the SBApplication for the mail app
Class $SBApplicationController = objc_getClass("SBApplicationController");
SBApplication *mailApp = [[$SBApplicationController sharedInstance] applicationWithDisplayIdentifier:#"com.apple.mobilemail"];
// Get the SBApplicationIcon for the mail app
SBApplicationIcon *mailAppIcon = [[objc_getClass("SBApplicationIcon") alloc] initWithApplication:mailApp];
The important thing is to get the right DisplayIdentifier of the app you're interested in.
Hope this help! any problems please shout.
Although, I accept the above as the answer, I ended up using the following code, which displays titles and badges:
SBIcon *sbIcon = [model applicationIconForDisplayIdentifier:identifier];
SBIconView *app = [[%c(SBIconView) alloc] initWithDefaultSize];
[app setIcon:sbIcon];
//if you want the titles to be conditional
[app setLabelHidden:!titlesEnabled];
//if you want the badge view to be conditional
id badgeView;
if (device_version >= 6.0) badgeView = MSHookIvar<id>(app, "_accessoryView");
else badgeView = MSHookIvar<id>(app, "_badgeView");
if (badgeView) [badgeView setHidden:!badgesEnabled];
As you can see, the simulator misses text on some buttons. I also saw this same behavior following along on the TapCounter demo off of YouTube.
Another issue (not shown in the screenshot) is that if you press on any key on TapCounter, NSString stringWithFormat (see below)
- (IBAction)add {
count++;
number.text = [NSString stringWithFormat:#"%i", count];
}
The act of executing the stringWithFormat line nukes the formatting on the label and reverts it to default value.
I did make sure that the simulator size and development size are identical, as you canm see.
This question appears a few times on this site. The answer at this related question worked for me, once I was able to interpret the instructions. Including getting the crash and fixing it.
Later: it appears that the fix of turning off auto-layout is enough to get the 6.0 simulator working - you might like to try this first to see if all the other stuff is actually necessary...
I'm trying to integrate Facebook sharing procedure into my app. I'm using UIActivityViewController like this:
NSArray * activityItems = #[self.imgView.image, self.txtField.text];
UIActivityViewController * activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
Till now all have been working fine. But I've met such problem - when I click on facebook icon and enter the facebook sharing screen the alertView appears:
so the problem is - when I click Setting my controller is just dismissed and nothing happens. For twitter all is working well - when Settings button is clicked my app is going background and the Settings is opened. Why this does not work for Facebook? Any help will be appriciated.
ADDED:
Using SLComposeViewController leads to the same behavior - Settings does not open
iOS 6.0.1 resolve this issue. Update software on device it go setting view.
i am having the same issue you update the ios from 6 to 6.0.1 and remove the verification type **SLServiceTypeFacebook** in **SLComposeViewController** at first.,thats all working fine for me now.
This bug seems to be fixed in new version of iOS (6.0.1) At least I have all working well since my last updgrade.
I just integrated the facebook social framework into my app and had exact same issue on iOS 6.1, i.e. when my facebook account is not setup, I will get this warning, but clicking "Setting" will simply dismiss the dialog instead of bringing me to the device's setting page.
I found out this seems to be a simulator ONLY issue, it works perfectly on real device. I'd suggest you to give a try.
I'm trying to integrate Facebook sharing procedure into my app. I'm using UIActivityViewController like this:
NSArray * activityItems = #[self.imgView.image, self.txtField.text];
UIActivityViewController * activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
Till now all have been working fine. But I've met such problem - when I click on facebook icon and enter the facebook sharing screen the alertView appears:
so the problem is - when I click Setting my controller is just dismissed and nothing happens. For twitter all is working well - when Settings button is clicked my app is going background and the Settings is opened. Why this does not work for Facebook? Any help will be appriciated.
ADDED:
Using SLComposeViewController leads to the same behavior - Settings does not open
iOS 6.0.1 resolve this issue. Update software on device it go setting view.
i am having the same issue you update the ios from 6 to 6.0.1 and remove the verification type **SLServiceTypeFacebook** in **SLComposeViewController** at first.,thats all working fine for me now.
This bug seems to be fixed in new version of iOS (6.0.1) At least I have all working well since my last updgrade.
I just integrated the facebook social framework into my app and had exact same issue on iOS 6.1, i.e. when my facebook account is not setup, I will get this warning, but clicking "Setting" will simply dismiss the dialog instead of bringing me to the device's setting page.
I found out this seems to be a simulator ONLY issue, it works perfectly on real device. I'd suggest you to give a try.
I am using ShareKit plugin for iPhone to enable social sharing for the application I'm working on. I set up everything, I stripped it to have Facebook and Twitter services only, connected successfully to both and now I have 1 problem in each of the services...
The problem with Twitter is how to logout/signout...
ShareKit sends the text and the url to Twitter's publish box. It is saving status perfectly. The question is where to put "logout" button for twitter? I want the iPhone user to logout in order to change username. This is done by calling the method
[SHKTwitter logout];.
Now, the problem is where to put the button that will fire this method? In navigationToolbar of Twitter actionSheet I already have 2 buttons and the toolbar (bottom one) is covered by the keyboard?
[EDIT]: I solved this issue by modifying the twitter action sheet. I resized the textView and then added UIToolbar and changed its position so that it fits into the gap between the keyboard and textView. Into the toolbar I added one button with an action that calls a logoutTwitter method
Facebook problem is more of a mystery...
So, in my sharreKitButtonHandler I have the following code:
NSURL *url = [NSURL URLWithString:#"http://www.domain.com"];
SHKItem *shareItem = [SHKItem URL:url title:self.itemTitle.text];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:shareItem];
[actionSheet showFromToolbar:self.shareKitToolbar];
This code prepares some ivars of a shareItem object and in the case of Twitter shareKit manages to fill the status box so that user just needs to press publish and its done...
In the case of Facebook it is not working. FB dialog pops out and the share box is empty saying "What's on your mind?" The url and the title are not put into the publish form?
So, please if you have any clue what's going on in the latter problem or how to solve the former problem, I would really appreciate your help...
It takes five lines to add twitter. I wouldn't bother with Sharekit for that.
TWTweetComposeViewController *tweetView = [[TWTweetComposeViewController alloc] init];
[tweetView addImage:imageToShare;
[tweetView addURL:URLToShare];
[tweetView setInitialText:messageToShare];
[senderViewController presentViewController:tweetView animated:YES completion:nil];
I wanted to use sharekit for my projects, but it was difficult to use and after a week I gave up as I couldn't share more than one thing at the same time (URL, Image, Message, etc.) which is pretty useless if you want to promote your app.
Facebook is more difficult, probably a 100 lines. It took me 3-4 days to implement. It will be integrated in iOS 6 just like Twitter :)