diff --git a/index.js b/index.js index e2f6133d..e934b38f 100644 --- a/index.js +++ b/index.js @@ -1,18 +1,31 @@ var NativeModules = require('NativeModules'); +var invariant = require('invariant'); var RNCookieManagerIOS = NativeModules.RNCookieManagerIOS; module.exports = { set(props, callback) { + invariant( + NativeModules.RNCookieManagerIOS, + 'Add RNCookieManagerIOS.h and RNCookieManagerIOS.m to your Xcode project.' + ); RNCookieManagerIOS.set(props, (err, res) => { callback(err, res); }); }, clearAll(callback) { + invariant( + NativeModules.RNCookieManagerIOS, + 'Add RNCookieManagerIOS.h and RNCookieManagerIOS.m to your Xcode project.' + ); RNCookieManagerIOS.clearAll((err, res) => { callback(err, res); }); }, getAll(callback) { + invariant( + NativeModules.RNCookieManagerIOS, + 'Add RNCookieManagerIOS.h and RNCookieManagerIOS.m to your Xcode project.' + ); RNCookieManagerIOS.getAll((err, res) => { callback(err, res); });