将额外的委托添加到Cordova AppDelegate iOS

编程入门 行业动态 更新时间:2024-10-22 15:31:10
本文介绍了将额外的委托添加到Cordova AppDelegate iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

根据文档,我正在构建一个插件以将外部框架集成到Cordova,我需要为我的应用程序的AppDelegate.h包括一个新的委托.

I am building a plugin to integrate an external framework to an Cordova, following the documentation, I need to include a new delegate to AppDelegate.h of my app.

如果正在开发本机应用程序,我只需要导入文件并在其上包含委托即可.

If was developing a native application, i just need to import the file and include the delegate on it.

#import <MySpinServerSDK/MySpinServerSDK.h> @interface AppDelegate : UIResponder <UIApplicationDelegate, MySpinServerSDKDelegate>

如何使用插件结构向iOS的Cordova应用添加额外的委托人?

How can I add a extra delegate to a Cordova App for iOS using the plugin structure?

我在插件中做了所有准备工作(外部框架为plist配置),但不确定是否可以使用cordova插件创建这种集成.

I did all the preparation in a plugin (external frameworks an plist configuration) but not sure if its possible to create this kind of integration using cordova plugins.

推荐答案

您可以引用以下Cordova插件作为示例:应用程序事件或深层链接

You can reference these Cordova Plugins as examples: App-Event or Deep Links

请注意,App Event开发人员如何在其Cordova插件中使用加号命名新文件:AppDelegate + APPAppEvent.h和AppDelegate + APPAppEvent.m.在头文件中,开发人员在将新类声明为AppDelegate时使用了类别"APPAppEvent":

Note how the App Event developer named the new files with a plus sign: AppDelegate+APPAppEvent.h and AppDelegate+APPAppEvent.m in his Cordova plugin. In the header file, the developer used a category "APPAppEvent" while declaring his new class as an AppDelegate:

@interface AppDelegate (APPAppEvent) @end

Deep Links开发人员做了相同的事情:

The Deep Links developer did the same:

@interface AppDelegate (CULPlugin) - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler; @end

更多推荐

将额外的委托添加到Cordova AppDelegate iOS

本文发布于:2023-11-27 08:11:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637226.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cordova   AppDelegate   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!