如何解决UIAlertView 的问题已折旧
我正在使用 Cordova 10 创建我的第一个 IOS 应用程序,我非常新手,因为它是我的第一个应用程序。 在cordova上,我安装了两个plus gin
- cordova-plugin-notification
- cordiva-plugin-network-information
我安装第一个只是为了让智能手机响起。我不需要警报,道具(等) 我安装了第二个只是为了检查智能手机是否通过 WiFi 或 gsm 网络连接。
实际上,我用 Xcode 模拟了我的应用程序,因为我有很多警告
UIAlertView' 已弃用:首先在 iOS 9.0 中弃用
'currentRadioAccessTechnology' 已弃用:首先在 iOS 中弃用 12.0
我对ObjectiveC很感兴趣,我真的不知道如何更新插件,但首先如何更新depreciate函数。
从那时起,我有一些问题
Q1:有没有办法在没有cordova-plugin-notification的情况下让智能手机响铃?
但最好更新代码或注释不可用的代码。 我也读过,
使用具有首选样式的 UIAlertController UIAlertControllerStyleAlert 代替
第 2 季度。如何在不破坏我的应用程序的情况下简单地替换 UIAlertController 并调整以下代码? 请记住,我没有开发插件,我是ObjectivC的新手(我害怕通过修改这部分代码来破坏应用程序)
[编辑] 这是一个会出现问题的函数示例
* Callback invoked when an alert dialog's buttons are clicked.
*/
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
CDVAlertView* cdvAlertView = (CDVAlertView*)alertView;
CDVPluginResult* result;
// Determine what gets returned to JS based on the alert view type.
if (alertView.alertViewStyle == UIAlertViewStyleDefault) {
// For alert and confirm,return button index as int back to JS.
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)(buttonIndex + 1)];
} else {
// For prompt,return button index and input text back to JS.
NSString* value0 = [[alertView textFieldAtIndex:0] text];
NSDictionary* info = @{
@"buttonIndex":@(buttonIndex + 1),@"input1":(value0 ? value0 : [NSNull null])
};
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:info];
}
[self.commandDelegate sendPluginResult:result callbackId:cdvAlertView.callbackId];
}
对于熟悉 Cordova 的开发人员来说,是否有一种解决方法来检查网络并发出提示音?
非常感谢您的建议
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。