提交 62e1c914 authored 作者: JarvanMo's avatar JarvanMo

fluwx now can handle reponse by itself on iOS,so we don't have to override…

fluwx now can handle reponse by itself on iOS,so we don't have to override application method in AppDelegate.m
上级 b29f92d1
## 0.2.0
* iOS支持Swift了。
## 0.1.9
* 修复了不传*thumbnail*在Android上会崩溃的bug。
......
......@@ -42,7 +42,7 @@
add the following in your `pubspec.yaml` file:
```yaml
dependencies:
fluwx: ^0.1.9
fluwx: ^0.2.0
```
......
......@@ -43,7 +43,7 @@
在`pubspec.yaml`文件中添加如下代码:
```yaml
dependencies:
fluwx: ^0.1.9
fluwx: ^0.2.0
```
......
......@@ -21,11 +21,11 @@
// return [WXApi handleOpenURL:url delegate:[FluwxResponseHandler responseHandler]];
//}
// NOTE: 9.0以后使用新API接口
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
{
return [WXApi handleOpenURL:url delegate:[FluwxResponseHandler responseHandler]];
}
//- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options
//{
// return [WXApi handleOpenURL:url delegate:[FluwxResponseHandler responseHandler]];
//}
//
- (void)applicationWillResignActive:(UIApplication *)application {
......
......@@ -27,6 +27,7 @@
@class FluwxPaymentHandler;
extern BOOL isWeChatRegistered;
extern BOOL handleOpenURLByFluwx;
@interface FluwxPlugin : NSObject<FlutterPlugin> {
......
#import <fluwx/FluwxPlugin.h>
#import "WXApi.h"
#import "FluwxAuthHandler.h"
#import "FluwxWXApiHandler.h"
#import "FluwxPaymentHandler.h"
@implementation FluwxPlugin
BOOL isWeChatRegistered = NO;
BOOL handleOpenURLByFluwx = YES;
- (void)dealloc
{
......@@ -31,6 +30,10 @@ BOOL isWeChatRegistered = NO;
- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
self = [super init];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleOpenURL:)
name:@"WeChat"
object:nil];
if (self) {
_fluwxShareHandler = [[FluwxShareHandler alloc] initWithRegistrar:registrar];
_fluwxAuthHandler = [[FluwxAuthHandler alloc] initWithRegistrar:registrar];
......@@ -80,6 +83,16 @@ BOOL isWeChatRegistered = NO;
}
-(BOOL)handleOpenURL:(NSNotification *)aNotification {
if(handleOpenURLByFluwx){
NSString * aURLString = [aNotification userInfo][@"url"];
NSURL * aURL = [NSURL URLWithString:aURLString];
return [WXApi handleOpenURL:aURL delegate:[FluwxResponseHandler responseHandler]];
} else{
return NO;
}
}
- (void)unregisterApp:(FlutterMethodCall *)call result:(FlutterResult)result {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论