将额外的委托添加到Cordova AppDelegate iOS [英] Add extra delegate to Cordova AppDelegate iOS

查看:190
本文介绍了将额外的委托添加到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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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