Xamarin.ios 的短信第三方平台

SMS third-party platform for Xamarin.ios

我正在应用程序中创建一个 Xamarin.ios 应用程序,我喜欢通过选定的联系人列表通过短信发送通知。短信第三方平台使用有什么建议吗?

如果您只需要为 Xamarin.iOS 应用实现它们,您可以在此处参考 Xamarin 文档:

对于Xamarin.forms所有平台,这里有两个相关的第三方:

对于 Xamarin 站点上的解决方案,有一个替代解决方案,使用 MessageUI。它提供了更大的灵活性,因为您可以指定多个收件人和一个 SMS 正文。根据我的经验,启动速度似乎也更快。

示例代码:

if (MFMessageComposeViewController.CanSendText)
{
    var smsViewController = new MFMessageComposeViewController()
    {
        Body = "An SMS with content!",
        Recipients = new string[] { number },

    };

    smsViewController.Finished += (sender, e) =>
        this.DismissViewController(true, null);


    this.PresentViewController(smsViewController, true, null);
}

请记住,模拟器不支持 SMS。 MFMessageComposeViewControllerCanSendText 属性 总是 return false.

这仅适用于设备。