Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 10 iMessage crash #106

Open
pirrate opened this issue Sep 22, 2016 · 24 comments
Open

iOS 10 iMessage crash #106

pirrate opened this issue Sep 22, 2016 · 24 comments

Comments

@pirrate
Copy link

pirrate commented Sep 22, 2016

After updating to iOS 10 when i type letter "İ" (uppercase i but turkish) on iMessage it crashes and shuts down. I mean iMessage crashes not keyboard. The strange thing it doesnt crashed anywhere else and iMessage itself doesnt crash when i type any other uppercase or lowercase letter. Strange.. Any idea?

@AaronFW
Copy link

AaronFW commented Sep 22, 2016

Can you push your current version to your Github so that I can look at it? I do not know that I will be able to identify the problem, but it will be a little easier to look at.

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

@AaronFW İ have messed a lot of things so it is not ready to be pushed but you can download this version and test it here. Because i also took this one as it is already converted to swift 3.0. https://github.com/polishedcode/tasty-imitation-keyboard Just edit json file and add this letter somewhere "İ" and try to type it in iMessage. I have tested in Emulator and real device the problem is the same.

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

Or if you have converted your code to Swift 3.0 you can try with your own too. Because i am sure result will be the same.

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

Just one correction the same issue is on iMessage and Messages. So you test it with Messages app in Simulator.

@AaronFW
Copy link

AaronFW commented Sep 22, 2016

My own code is built on a form vastly different than the original Tasty-Imitation-Keyboard, it did not have the problem.

I downloaded Archagon's Tasty-Imitation-Keyboard, and updated the Syntax to Swift 2.3. iMessage then did crash with that character, just like you said.

After enough tries, it gave me an error report saying "** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSBigMutableString getCharacters:range:]: Range {0, 5} out of bounds; string length 4'".

I am also trying to compare it to my own code to see what differs. However, it is 4am for me. I will continue looking at it later.

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

Thanks for information. how you got this error? i dont receive any errors. also i mentioned that even when custom keyboard and i just copy/paste that "İ" from somewhere (i mean without typing) Messages crash again. Also i found out that if i put 2 \n before "İ" then no crash happens. I dont know what is the real reason :)

@AaronFW
Copy link

AaronFW commented Sep 22, 2016

I got the error after entering the İ a few times in iMessage. I have attached a Screenshot of the error and the full text. Now, (providing that the error is not still open in the background) I usually get the error every time.

screen shot 2016-09-22 at 8 41 14 am

[pirrate-error-text.txt](https://github.com/archagon/tasty-imitation-keyboard/files/487256/pirrate-error-text.txt)

@AaronFW
Copy link

AaronFW commented Sep 22, 2016

Also, regarding the İ; isn't the lowercase "i"? The keyboard types the lowercase as the following:
screen shot 2016-09-22 at 9 18 34 am

Or is it supposed to be that way?

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

yes the lowercase is i just for some reason when swift converts İ to lowercase it converts it to the letter that you wrote. i use proxy.insertText(("\u{0130}").uppercased(with:Locale(identifier: "tr")))

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

this really annoys me. Tried 100 methods to fix it but still no result.

@AaronFW
Copy link

AaronFW commented Sep 22, 2016

I will write someone regarding the Unicode issue with lowercase.

I will continue to try to establish why the İ is not working in Archagon's version but works in mine. For reference, my code is available on through my Fork. It should also be current. The most important files are probably DefaultKeyboard.Swift and KeyboardModel.Swift. The code isn't the cleanest: I took PolishedCode's version and modified it to my needs. My project is a keyboard for the Kouri-Vini Language and PolishedCode had a lot of things I did not need and I have not yet removed it all.

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

Strange, i have tested your code and it works fine. I am also looking now and trying to find difference.

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

any progress?

@pirrate
Copy link
Author

pirrate commented Sep 22, 2016

i have updated iPhone to ios 10.1 public beta. Now everything work fine :D

@AaronFW
Copy link

AaronFW commented Sep 22, 2016

It is good to hear that it seems to work fine for iPhone 10.1 beta.

I have been working and I haven't been able to look at it since I wrote last.

However, during my lunch-break, I did write a Bug Report to Apple regarding the İ, so please keep this Issue Open until I can report back when I hear back from Apple.

@pirrate
Copy link
Author

pirrate commented Sep 24, 2016

iOS 10.0.2 still has this issue

@pirrate
Copy link
Author

pirrate commented Sep 24, 2016

@AaronFW i am curious why your version doesn`t have this issue? What is your swift version? 2.3? i looked at the codes there are nothing specially different on insert text parts. Still a big question for me. May be there are some option on build parameters?

@AaronFW
Copy link

AaronFW commented Sep 24, 2016

My Kouri-Vini Keyboard does not produce the error, but I did made a Tasty-Imitation-Keyboard that does produce the error. They are both Swift 2.3. I still cannot identify what the problem is.

@pirrate
Copy link
Author

pirrate commented Sep 24, 2016

Seriously, you version has some difference. I tried to convert tasty-imitation to 2.3 i gave me error for using "dynamicType" as it is deprecated. But in your source code you are using it. Are you sure it is SWIFT 2.3? :)

@AaronFW
Copy link

AaronFW commented Sep 24, 2016

Well, I updated setupLayout() in KeyboardViewController to
self.layout = self.dynamicType.layoutClass.init(model: self.keyboard, superview: self.forwardingView, layoutConstants: self.dynamicType.layoutConstants, globalColors: self.dynamicType.globalColors, darkMode: self.darkMode(), solidColorMode: self.solidColorMode())

Then since it wasn't important for the thing that you wanted resolved, I commented out the section in createSettings().

func createSettings() -> ExtraView? { // note that dark mode is not yet valid here, so we just put false for clarity // let settingsView = DefaultSettings(globalColors: self.dynamicType.globalColors, darkMode: false, solidColorMode: self.solidColorMode()) // settingsView.backButton?.addTarget(self, action: #selector(KeyboardViewController.toggleSettings), forControlEvents: UIControlEvents.TouchUpInside) return settingsView }

But yes, it is Swift 2.3. After that, it is fit for Swift 2.3.

@pirrate
Copy link
Author

pirrate commented Sep 24, 2016

I have tested version of @klimslim and it doesn`t have issue. I can type İ with it without any problem. https://github.com/klimslim/tasty-imitation-keyboard

@pirrate
Copy link
Author

pirrate commented Sep 25, 2016

@AaronFW after 2 days sleepless nights i fixed that shit. This is for sure iOS 10 bug. The problem was PrimaryLanguage option in NSExtension section of info.plist It was tr_TR before. I changed it "tr" now it works without any problem.
screen shot 2016-09-25 at 11 55 21 am

@AaronFW
Copy link

AaronFW commented Sep 25, 2016

Ah, good job. I am glad it is fixed. :)

@AaronFW
Copy link

AaronFW commented Oct 26, 2016

@pirrate I finally heard back from someone from Apple regarding the "İ" being turned to lowercase incorrectly. The wrote the following:

Please send us the output of the following two commands run in Terminal.app (/Applications/Utilities/Terminal.app):

defaults read -g AppleLanguages
defaults read -g AppleLocale

Because you also experience the problem, can you run those commands in Terminal and send me the results? I will pass them on to Apple in the Bug Reporter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants