如何直接在iPhone中将OTP从用户的消息框填充到应用程序? [英] How to populate OTP from user's message box to application directly in iPhone?

查看:160
本文介绍了如何直接在iPhone中将OTP从用户的消息框填充到应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个互联网交易应用程序,其移动和iPhone应用程序可用。根据最近的市场趋势,我们正在努力实现双因素身份验证。为此,我们将在用户的注册手机号码上发送一次性密码作为短信。

I am working on an internet trading application with its mobile and iPhone applications available. With the recent market trend, we are working on including two-factor authentication. For that, we will be sending a one-time password as a sms on user's registered mobile number.

有没有办法,OTP可以自动填入应用程序来自用户的iPhone消息框?我应该使用什么算法让我的应用程序读取用户的消息框?

Is there a way,that the OTP can get automatically populated into application from user's message box in iPhone? What algorithm should I use to make my app read user's message box?

提前致谢:)

推荐答案

您可以从您的应用程序访问SMS。因此,最好让用户输入他的联系电话号码并发送短信给他的手机

You can Access SMS from your app. So better make user to enter his contact number and send SMS to his mobile

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    if (!url) {
        UIApplication * yourapplication =[UIApplication sharedApplication];
        NSString *outputpath =@"appname://data/";
        NSURL *url =[NSURL URLWithString:outputpath];
        [yourapplication openURL:url];
        return NO;
    }

    NSUserDefaults *defaultString =[NSUserDefaults standardUserDefaults];
    NSString * commonString =[url absoluteString];
    if (commonString.length<=15) {
        //
    }
    else
    {
        [defaultString setObject:commonString forKey:@"urlString"];
    }
         //send info to the screen you need and can navigate
    return YES;
}

这篇关于如何直接在iPhone中将OTP从用户的消息框填充到应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆