Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
OneTimeCode
-
@JonB Sorry for the delay, dinner time 😢
No crash but how to check if script ok: keyboard of tf seems usual... -
Now THAT I don't know...
what does tfo.textContentType() return?
I think you'd have to text yourself from another phone with a text that has a code. Then you might need to have the auto correct/suggestion thing above the keyboard enabled, and it should show the code as a suggestion.
-
@JonB return is None.
Hoping all this spent time will help @AlbertoAEC -
From stack overflow
First of all, the SMS need to have the keyword "code" or "passcode" into their message, and don't use spaces after the code. if you received the SMS and you have the button "Copy Code" then it will works
-
@cvp are you on ios12?
Seems like this didn't actually work...
-
@JonB iOS 12.1, but don't forget I am not the requester. I only tried to help, without success if without you 😢
-
@cvp @JonB THANK YOU VERY MUCH!!
It works perfectly.
You can try the code using other content type like phone number.
UITextContentTypeTelephoneNumberimport ui from objc_util import * load_framework('UIKit') UITextContentTypeOneTimeCode=c_void_p.in_dll(c, 'UITextContentTypeTelephoneNumber') if UITextContentTypeOneTimeCode: UITextContentTypeOneTimeCode = ObjCInstance(UITextContentTypeOneTimeCode) tf = ui.TextField() tf.keyboard_type = ui.KEYBOARD_NUMBER_PAD tfo=tf.objc_instance.textField() print(tfo.setTextContentType_.encoding) my_method = ObjCInstanceMethod(tfo, 'setTextContentType_') my_method.sel_name='setTextContentType:' my_method.encoding=b'v@:@' my_method(UITextContentTypeOneTimeCode) tf.present('sheet')
I couldn’t answer to you before because I was working.
Best regards,
Alberto -
@AlbertoAEC 👍 and one proof more, if needed, that @JonB is our guru
-
@AlbertoAEC and you can comment the load_framework, I think
#load_framework('UIKit')
-
@cvp yes, load_framework is no needed.
Thanks to both of you for your time