forked from iStig/JavaScriptCoreDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSNativeMethod.h
More file actions
74 lines (49 loc) · 2.03 KB
/
JSNativeMethod.h
File metadata and controls
74 lines (49 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#import <Foundation/Foundation.h>
#import <JavaScriptCore/JavaScriptCore.h>
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MediaPlayer/MediaPlayer.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import "GpsManager.h"
#import "QRCodeReaderDelegate.h"
#import "QRCodeReaderViewController.h"
#import "QRCodeReader.h"
#import "Order.h"
#import "DataSigner.h"
#import <AlipaySDK/AlipaySDK.h>
#import "Product.h"
#import "AFNetworking.h"
#import "OpenShareHeader.h"
#import <Social/Social.h>
//首先创建一个实现了JSExport协议的协议
@protocol TestJSObjectProtocol <JSExport>
- (NSString *)fetchLocalStorageWithKey:(NSDictionary *)keyDic;
- (void)setuplocalstoragekey:(NSDictionary *)keyDic value:(NSDictionary *)valueDic;
- (void)removeLocalStorageWithKey:(NSDictionary *)keyDic;
//此处我们测试几种参数的情况
- (NSString *)imgCallBack:(NSString *)url;
// 通过JSON传过来
- (void)callWithDict:(NSDictionary *)params;
// 第三方分享
- (void)shareSDK:(NSDictionary *)params;
// 第三方登录
- (void)thirdLogin:(NSDictionary *)params;
// 不急测试第三方分享
- (void)bujiShareSDK:(NSDictionary *)params;
// JS调用此方法来调用OC的系统相册方法
- (void)callSystemCamera;
// js调用系统扫一扫二维码
- (void)callSystemQRScan;
// JS调用支付
- (void)jsCallPayment:(NSDictionary *)price;
// JS调用OC,然后在OC中通过调用JS方法来传值给JS。
- (void)jsCallObjcAndObjcCallJsWithDict:(NSDictionary *)params;
// 在JS中调用时,函数名应该为showAlertMsg(arg1, arg2)
// 这里是只两个参数的。
- (void)showAlert:(NSString *)title msg:(NSString *)msg;
@end
@interface JSNativeMethod : NSObject<TestJSObjectProtocol,QRCodeReaderDelegate,UIImagePickerControllerDelegate, UINavigationControllerDelegate,CLLocationManagerDelegate,NSURLSessionDelegate,UIActionSheetDelegate>
@property (nonatomic, weak) JSContext *jsContext;
@property (nonatomic, weak) UIViewController *viewController;
@property (nonatomic, strong) CLLocationManager *manager;
@end