Ios Twitter数字:如何以编程方式发送确认码(sms)?
有没有一种方法可以通过编程发送sms代码?无数字魔术视图控制器 示例代码没有帮助Ios Twitter数字:如何以编程方式发送确认码(sms)?,ios,objective-c,twitter-digits,Ios,Objective C,Twitter Digits,有没有一种方法可以通过编程发送sms代码?无数字魔术视图控制器 示例代码没有帮助 // Objective-C - (void)didTapButton { Digits *digits = [Digits sharedInstance]; DGTAuthenticationConfiguration *configuration = [[DGTAuthenticationConfiguration alloc] initWithAccountFields:DGTAccountF
// Objective-C
- (void)didTapButton {
Digits *digits = [Digits sharedInstance];
DGTAuthenticationConfiguration *configuration = [[DGTAuthenticationConfiguration alloc] initWithAccountFields:DGTAccountFieldsDefaultOptionMask];
configuration.phoneNumber = @"+345555555555";
[digits authenticateWithViewController:nil configuration:configuration completion:^(DGTSession *newSession, NSError *error){
// Country selector will be set to Spain and phone number field will be set to 5555555555
}];
}
我在[Digits sharedInstance]中找到了一个authenticateWithPhoneNumber方法,但看起来它已经被弃用了
- (void)authenticateWithPhoneNumber:(twtr_nullable NSString *)phoneNumber digitsAppearance:(twtr_nullable DGTAppearance *)appearance
viewController:(twtr_nullable UIViewController *)viewController
title:(twtr_nullable NSString *)title completion:(DGTAuthenticationCompletion)completion
__attribute__((deprecated("Use authenticateWithViewController:configuration:completion: instead.")));
UPD我从Twitter上得到了某种官方回应:
好问题!到目前为止,这不是目前内置的数字,但这是我们已经听到不少人要求的东西
所以,现在不可能。但我并不是为了节省某人在调查同一问题时的时间而删除这个问题。或者有人可以帮我解决问题。苹果不允许你通过程序发送短信。为此,您需要连接到远程服务器。我很确定苹果没有提供任何短信服务器。我以前使用过Twilio,但找不到通过Twitter DigitsApple以编程方式发送短信的消息。苹果没有可以编程使用的短信服务器或其他API。这是故意的。他们提供的是一个API,您可以在其中向用户显示SMS,用户单击发送按钮发送文本。看看Xcode文档中的MFMessageComposeViewController。有关更多信息,请参阅此链接: