将额外的委托添加到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