1 Star 0 Fork 0

UnPourTous/react-native-cookies

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 927 Bytes
一键复制 编辑 原始数据 按行查看 历史
import React from 'react';
import {NativeModules, Platform} from 'react-native';
var invariant = require('invariant');
var RNCookieManagerIOS = NativeModules.RNCookieManagerIOS;
var RNCookieManagerAndroid = NativeModules.RNCookieManagerAndroid;
var CookieManager;
if (Platform.OS === 'ios') {
invariant(RNCookieManagerIOS,
'Add RNCookieMangerIOS.h and RNCookieManagerIOS.m to your Xcode project');
CookieManager = RNCookieManagerIOS;
} else if (Platform.OS === 'android') {
invariant(RNCookieManagerAndroid, 'Import libraries to android "rnpm link"');
CookieManager = RNCookieManagerAndroid;
} else {
invariant(CookieManager, "Invalid platform");
}
var functions = [
'set',
'setFromResponse',
'get',
'getAll',
'clearAll',
'clearByName'
];
module.exports = {}
for (var i=0; i < functions.length; i++) {
module.exports[functions[i]] = CookieManager[functions[i]];
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/UnPourTous/react-native-cookies.git
[email protected]:UnPourTous/react-native-cookies.git
UnPourTous
react-native-cookies
react-native-cookies
master

搜索帮助