本人使用的是 cordova-plugin-alipay-v2cordova-plugin-wechat-v3两款插件,其他类似插件如果有同样问题的处理思路是一样的,因为IonicDeepLink插件在遇到不是自己注册的url_scheme时会发出CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification这个通知而不是原来的CDVPluginHandleOpenURL,所以需要在其他插件中实现处理该通知的方法即可。

对于cordova-plugin-alipay-v2来说,需要修改alipay.m,而cordova-plugin-wechat-v3则是CDVWechat.m文件。

在原来的handleOpenURL方法之下添加一个handleOpenURLWithApplicationSourceAndAnnotation方法;

1
2
3
4
5
6
- (void)handleOpenURLWithApplicationSourceAndAnnotation:(NSNotification *)notification
{
    NSURL* url = [[notification object] objectForKey:@"url"];
  
    // 插件原处理逻辑,可复制插件原`handleOpenURL`方法中的相关代码
}