├── LICENSE ├── README.md ├── android ├── native-gradle-node-folder │ ├── .gitignore │ ├── README.md │ ├── app │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── build.gradle │ │ ├── libnode │ │ │ ├── bin │ │ │ │ ├── arm64-v8a │ │ │ │ │ └── copy-libnode.so-here │ │ │ │ ├── armeabi-v7a │ │ │ │ │ └── copy-libnode.so-here │ │ │ │ ├── x86 │ │ │ │ │ └── copy-libnode.so-here │ │ │ │ └── x86_64 │ │ │ │ │ └── copy-libnode.so-here │ │ │ └── include │ │ │ │ └── node │ │ │ │ ├── android-ifaddrs.h │ │ │ │ ├── chakra_ttd.h │ │ │ │ ├── common.gypi │ │ │ │ ├── config.gypi │ │ │ │ ├── libplatform │ │ │ │ ├── libplatform-export.h │ │ │ │ ├── libplatform.h │ │ │ │ └── v8-tracing.h │ │ │ │ ├── node.h │ │ │ │ ├── node_api.h │ │ │ │ ├── node_api_types.h │ │ │ │ ├── node_buffer.h │ │ │ │ ├── node_object_wrap.h │ │ │ │ ├── node_version.h │ │ │ │ ├── openssl │ │ │ │ ├── aes.h │ │ │ │ ├── archs │ │ │ │ │ ├── BSD-x86 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── BSD-x86_64 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── VC-WIN32 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── VC-WIN64A │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── aix-gcc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── aix64-gcc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── darwin-i386-cc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── darwin64-x86_64-cc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-aarch64 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-armv4 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-elf │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-ppc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-ppc64 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-x32 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux-x86_64 │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux32-s390x │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── linux64-s390x │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ ├── solaris-x86-gcc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ │ └── solaris64-x86_64-gcc │ │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── asn1.h │ │ │ │ ├── asn1_mac.h │ │ │ │ ├── asn1t.h │ │ │ │ ├── bio.h │ │ │ │ ├── blowfish.h │ │ │ │ ├── bn.h │ │ │ │ ├── buffer.h │ │ │ │ ├── camellia.h │ │ │ │ ├── cast.h │ │ │ │ ├── cmac.h │ │ │ │ ├── cms.h │ │ │ │ ├── comp.h │ │ │ │ ├── conf.h │ │ │ │ ├── conf_api.h │ │ │ │ ├── crypto.h │ │ │ │ ├── des.h │ │ │ │ ├── des_old.h │ │ │ │ ├── dh.h │ │ │ │ ├── dsa.h │ │ │ │ ├── dso.h │ │ │ │ ├── dtls1.h │ │ │ │ ├── e_os2.h │ │ │ │ ├── ebcdic.h │ │ │ │ ├── ec.h │ │ │ │ ├── ecdh.h │ │ │ │ ├── ecdsa.h │ │ │ │ ├── engine.h │ │ │ │ ├── err.h │ │ │ │ ├── evp.h │ │ │ │ ├── hmac.h │ │ │ │ ├── idea.h │ │ │ │ ├── krb5_asn.h │ │ │ │ ├── kssl.h │ │ │ │ ├── lhash.h │ │ │ │ ├── md4.h │ │ │ │ ├── md5.h │ │ │ │ ├── mdc2.h │ │ │ │ ├── modes.h │ │ │ │ ├── obj_mac.h │ │ │ │ ├── objects.h │ │ │ │ ├── ocsp.h │ │ │ │ ├── opensslconf.h │ │ │ │ ├── opensslv.h │ │ │ │ ├── ossl_typ.h │ │ │ │ ├── pem.h │ │ │ │ ├── pem2.h │ │ │ │ ├── pkcs12.h │ │ │ │ ├── pkcs7.h │ │ │ │ ├── pqueue.h │ │ │ │ ├── rand.h │ │ │ │ ├── rc2.h │ │ │ │ ├── rc4.h │ │ │ │ ├── ripemd.h │ │ │ │ ├── rsa.h │ │ │ │ ├── safestack.h │ │ │ │ ├── seed.h │ │ │ │ ├── sha.h │ │ │ │ ├── srp.h │ │ │ │ ├── srtp.h │ │ │ │ ├── ssl.h │ │ │ │ ├── ssl2.h │ │ │ │ ├── ssl23.h │ │ │ │ ├── ssl3.h │ │ │ │ ├── stack.h │ │ │ │ ├── symhacks.h │ │ │ │ ├── tls1.h │ │ │ │ ├── ts.h │ │ │ │ ├── txt_db.h │ │ │ │ ├── ui.h │ │ │ │ ├── ui_compat.h │ │ │ │ ├── whrlpool.h │ │ │ │ ├── x509.h │ │ │ │ ├── x509_vfy.h │ │ │ │ └── x509v3.h │ │ │ │ ├── pthread-barrier.h │ │ │ │ ├── stdint-msvc2008.h │ │ │ │ ├── tree.h │ │ │ │ ├── uv-aix.h │ │ │ │ ├── uv-bsd.h │ │ │ │ ├── uv-darwin.h │ │ │ │ ├── uv-errno.h │ │ │ │ ├── uv-linux.h │ │ │ │ ├── uv-os390.h │ │ │ │ ├── uv-posix.h │ │ │ │ ├── uv-sunos.h │ │ │ │ ├── uv-threadpool.h │ │ │ │ ├── uv-unix.h │ │ │ │ ├── uv-version.h │ │ │ │ ├── uv-win.h │ │ │ │ ├── uv.h │ │ │ │ ├── v8-debug.h │ │ │ │ ├── v8-inspector-protocol.h │ │ │ │ ├── v8-inspector.h │ │ │ │ ├── v8-platform.h │ │ │ │ ├── v8-profiler.h │ │ │ │ ├── v8-testing.h │ │ │ │ ├── v8-util.h │ │ │ │ ├── v8-value-serializer-version.h │ │ │ │ ├── v8-version-string.h │ │ │ │ ├── v8-version.h │ │ │ │ ├── v8.h │ │ │ │ ├── v8config.h │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── nodejs-project │ │ │ │ ├── main.js │ │ │ │ └── package.json │ │ │ ├── cpp │ │ │ └── native-lib.cpp │ │ │ ├── java │ │ │ └── com │ │ │ │ └── yourorg │ │ │ │ └── sample │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── native-gradle │ ├── .gitignore │ ├── .idea │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml │ ├── README.md │ ├── app │ ├── .gitignore │ ├── CMakeLists.txt │ ├── build.gradle │ ├── libnode │ │ ├── bin │ │ │ ├── arm64-v8a │ │ │ │ └── copy-libnode.so-here │ │ │ ├── armeabi-v7a │ │ │ │ └── copy-libnode.so-here │ │ │ ├── x86 │ │ │ │ └── copy-libnode.so-here │ │ │ └── x86_64 │ │ │ │ └── copy-libnode.so-here │ │ └── include │ │ │ └── node │ │ │ ├── android-ifaddrs.h │ │ │ ├── common.gypi │ │ │ ├── config.gypi │ │ │ ├── libplatform │ │ │ ├── libplatform-export.h │ │ │ ├── libplatform.h │ │ │ └── v8-tracing.h │ │ │ ├── node.h │ │ │ ├── node_api.h │ │ │ ├── node_api_types.h │ │ │ ├── node_buffer.h │ │ │ ├── node_object_wrap.h │ │ │ ├── node_version.h │ │ │ ├── openssl │ │ │ ├── aes.h │ │ │ ├── archs │ │ │ │ ├── BSD-x86 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── BSD-x86_64 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── VC-WIN32 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── VC-WIN64A │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── aix-gcc │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── aix64-gcc │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── darwin-i386-cc │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── darwin64-x86_64-cc │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-aarch64 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-armv4 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-elf │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-ppc │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-ppc64 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-x32 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux-x86_64 │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux32-s390x │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── linux64-s390x │ │ │ │ │ └── opensslconf.h │ │ │ │ ├── solaris-x86-gcc │ │ │ │ │ └── opensslconf.h │ │ │ │ └── solaris64-x86_64-gcc │ │ │ │ │ └── opensslconf.h │ │ │ ├── asn1.h │ │ │ ├── asn1_mac.h │ │ │ ├── asn1t.h │ │ │ ├── bio.h │ │ │ ├── blowfish.h │ │ │ ├── bn.h │ │ │ ├── buffer.h │ │ │ ├── camellia.h │ │ │ ├── cast.h │ │ │ ├── cmac.h │ │ │ ├── cms.h │ │ │ ├── comp.h │ │ │ ├── conf.h │ │ │ ├── conf_api.h │ │ │ ├── crypto.h │ │ │ ├── des.h │ │ │ ├── des_old.h │ │ │ ├── dh.h │ │ │ ├── dsa.h │ │ │ ├── dso.h │ │ │ ├── dtls1.h │ │ │ ├── e_os2.h │ │ │ ├── ebcdic.h │ │ │ ├── ec.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── engine.h │ │ │ ├── err.h │ │ │ ├── evp.h │ │ │ ├── hmac.h │ │ │ ├── idea.h │ │ │ ├── krb5_asn.h │ │ │ ├── kssl.h │ │ │ ├── lhash.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── mdc2.h │ │ │ ├── modes.h │ │ │ ├── obj_mac.h │ │ │ ├── objects.h │ │ │ ├── ocsp.h │ │ │ ├── opensslconf.h │ │ │ ├── opensslv.h │ │ │ ├── ossl_typ.h │ │ │ ├── pem.h │ │ │ ├── pem2.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs7.h │ │ │ ├── pqueue.h │ │ │ ├── rand.h │ │ │ ├── rc2.h │ │ │ ├── rc4.h │ │ │ ├── ripemd.h │ │ │ ├── rsa.h │ │ │ ├── safestack.h │ │ │ ├── seed.h │ │ │ ├── sha.h │ │ │ ├── srp.h │ │ │ ├── srtp.h │ │ │ ├── ssl.h │ │ │ ├── ssl2.h │ │ │ ├── ssl23.h │ │ │ ├── ssl3.h │ │ │ ├── stack.h │ │ │ ├── symhacks.h │ │ │ ├── tls1.h │ │ │ ├── ts.h │ │ │ ├── txt_db.h │ │ │ ├── ui.h │ │ │ ├── ui_compat.h │ │ │ ├── whrlpool.h │ │ │ ├── x509.h │ │ │ ├── x509_vfy.h │ │ │ └── x509v3.h │ │ │ ├── pthread-barrier.h │ │ │ ├── stdint-msvc2008.h │ │ │ ├── tree.h │ │ │ ├── uv-aix.h │ │ │ ├── uv-bsd.h │ │ │ ├── uv-darwin.h │ │ │ ├── uv-errno.h │ │ │ ├── uv-linux.h │ │ │ ├── uv-os390.h │ │ │ ├── uv-posix.h │ │ │ ├── uv-sunos.h │ │ │ ├── uv-threadpool.h │ │ │ ├── uv-unix.h │ │ │ ├── uv-version.h │ │ │ ├── uv-win.h │ │ │ ├── uv.h │ │ │ ├── v8-debug.h │ │ │ ├── v8-inspector-protocol.h │ │ │ ├── v8-inspector.h │ │ │ ├── v8-platform.h │ │ │ ├── v8-profiler.h │ │ │ ├── v8-testing.h │ │ │ ├── v8-util.h │ │ │ ├── v8-value-serializer-version.h │ │ │ ├── v8-version-string.h │ │ │ ├── v8-version.h │ │ │ ├── v8.h │ │ │ ├── v8config.h │ │ │ ├── zconf.h │ │ │ └── zlib.h │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ └── native-lib.cpp │ │ ├── java │ │ └── com │ │ │ └── yourorg │ │ │ └── sample │ │ │ └── MainActivity.java │ │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── cordova-angularjs ├── .bowerrc ├── .gitignore ├── .jshintrc ├── .nvmrc ├── README.md ├── bower.json ├── gulpfile.js ├── package-lock.json ├── package.json └── src │ ├── client │ ├── app │ │ └── app.js │ ├── css │ │ ├── index.css │ │ └── styles.css │ ├── dist │ │ ├── socket.io.js │ │ └── socket.io.js.map │ └── index.html │ └── server │ ├── main.js │ └── package.json ├── cordova └── UseNativeModules │ ├── .gitignore │ ├── .npmignore │ ├── README.md │ ├── config.xml │ ├── hooks │ └── README.md │ ├── package.json │ ├── res │ ├── README.md │ ├── icon │ │ ├── android │ │ │ ├── icon-36-ldpi.png │ │ │ ├── icon-48-mdpi.png │ │ │ ├── icon-72-hdpi.png │ │ │ └── icon-96-xhdpi.png │ │ └── ios │ │ │ ├── icon-57-2x.png │ │ │ ├── icon-57.png │ │ │ ├── icon-72-2x.png │ │ │ └── icon-72.png │ └── screen │ │ ├── android │ │ ├── screen-hdpi-landscape.png │ │ ├── screen-hdpi-portrait.png │ │ ├── screen-ldpi-landscape.png │ │ ├── screen-ldpi-portrait.png │ │ ├── screen-mdpi-landscape.png │ │ ├── screen-mdpi-portrait.png │ │ ├── screen-xhdpi-landscape.png │ │ └── screen-xhdpi-portrait.png │ │ └── ios │ │ ├── screen-ipad-landscape-2x.png │ │ ├── screen-ipad-landscape.png │ │ ├── screen-ipad-portrait-2x.png │ │ ├── screen-ipad-portrait.png │ │ ├── screen-iphone-landscape-2x.png │ │ ├── screen-iphone-landscape.png │ │ ├── screen-iphone-portrait-2x.png │ │ ├── screen-iphone-portrait-568h-2x.png │ │ └── screen-iphone-portrait.png │ └── www │ ├── css │ └── index.css │ ├── img │ └── logo.png │ ├── index.html │ ├── js │ └── index.js │ └── nodejs-project │ ├── main.js │ └── package.json ├── ios ├── native-xcode-node-folder │ ├── .gitignore │ ├── NodeMobile │ │ └── copy-NodeMobile.framework-here │ ├── README.md │ ├── native-xcode-node-folder.xcodeproj │ │ └── project.pbxproj │ ├── native-xcode-node-folder │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── NodeRunner.h │ │ ├── NodeRunner.mm │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m │ └── nodejs-project │ │ ├── main.js │ │ └── package.json └── native-xcode │ ├── .gitignore │ ├── README.md │ ├── libnode │ └── copy-libnode.framework-here │ ├── native-xcode.xcodeproj │ └── project.pbxproj │ └── native-xcode │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── NodeRunner.h │ ├── NodeRunner.mm │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── react-native ├── SuspendResume ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── README.md ├── __tests__ │ └── App.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── suspendresume │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── index.js ├── ios │ ├── SuspendResume.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── SuspendResume-tvOS.xcscheme │ │ │ └── SuspendResume.xcscheme │ └── SuspendResume │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m ├── nodejs-assets │ └── nodejs-project │ │ ├── main.js │ │ └── package.json ├── package-lock.json └── package.json ├── UseMultipleChannels ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── README.md ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── usemultiplechannels │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── index.js ├── ios │ ├── UseMultipleChannels.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── UseMultipleChannels-tvOS.xcscheme │ │ │ └── UseMultipleChannels.xcscheme │ └── UseMultipleChannels │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m ├── nodejs-assets │ └── nodejs-project │ │ ├── main.js │ │ └── package.json ├── package.json └── rn-cli.config.js └── UseNativeModules ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── README.md ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── usenativemodules │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── index.js ├── ios ├── UseNativeModules.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── UseNativeModules.xcscheme └── UseNativeModules │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ └── LaunchScreen.xib │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Info.plist │ └── main.m ├── nodejs-assets └── nodejs-project │ ├── main.js │ └── package.json ├── package.json └── rn-cli.config.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Janea Systems, Inc. and Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Project Status: Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it.](https://www.repostatus.org/badges/latest/unsupported.svg)](https://www.repostatus.org/#unsupported) 2 | 3 | :warning: The project is no longer being actively maintained by Janea Systems. 4 | Forks of the repos have been created on a dedicated Github org to allow community-driven development to continue: 5 | https://github.com/nodejs-mobile 6 | 7 | # Node.js on Mobile - Code Samples 8 | 9 | This is a collection of samples showcasing the use of [Node.js on Mobile](https://github.com/janeasystems/nodejs-mobile). 10 | 11 | It contains the following samples: 12 | * Android: [Native Gradle Sample](android/native-gradle) 13 | * Android: [Native Gradle Sample using a Node Project folder](android/native-gradle-node-folder) 14 | * iOS: [Native Xcode Sample](ios/native-xcode) 15 | * iOS: [Native Xcode Sample using a Node Project folder](ios/native-xcode-node-folder) 16 | * React-Native: [Suspend Resume Sample](react-native/SuspendResume) 17 | * React-Native: [Use Native Modules](react-native/UseNativeModules) 18 | * React-Native: [Use Multiple Channel Events](react-native/UseMultipleChannels) 19 | * Cordova: [Cordova App With AngularJS](cordova-angularjs) 20 | * Cordova: [Use Native Modules](cordova/UseNativeModules) 21 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | *.so 10 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.3" 6 | defaultConfig { 7 | applicationId "com.yourorg.sample" 8 | minSdkVersion 21 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | externalNativeBuild { 14 | cmake { 15 | cppFlags "" 16 | arguments "-DANDROID_STL=c++_shared" 17 | } 18 | } 19 | ndk { 20 | abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 21 | } 22 | } 23 | buildTypes { 24 | release { 25 | minifyEnabled false 26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 27 | } 28 | } 29 | externalNativeBuild { 30 | cmake { 31 | path "CMakeLists.txt" 32 | } 33 | } 34 | 35 | // If you want Gradle to package prebuilt native libraries 36 | // with your APK, modify the default source set configuration 37 | // to include the directory of your prebuilt .so files as follows. 38 | sourceSets { 39 | main { 40 | jniLibs.srcDirs 'libnode/bin/' 41 | } 42 | } 43 | } 44 | 45 | dependencies { 46 | compile fileTree(dir: 'libs', include: ['*.jar']) 47 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 48 | exclude group: 'com.android.support', module: 'support-annotations' 49 | }) 50 | compile 'com.android.support:appcompat-v7:25.3.1' 51 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 52 | testCompile 'junit:junit:4.12' 53 | } 54 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/bin/arm64-v8a/copy-libnode.so-here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaneaSystems/nodejs-mobile-samples/52347086d7076d59cf663850b4debd33b17de089/android/native-gradle-node-folder/app/libnode/bin/arm64-v8a/copy-libnode.so-here -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/bin/armeabi-v7a/copy-libnode.so-here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaneaSystems/nodejs-mobile-samples/52347086d7076d59cf663850b4debd33b17de089/android/native-gradle-node-folder/app/libnode/bin/armeabi-v7a/copy-libnode.so-here -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/bin/x86/copy-libnode.so-here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaneaSystems/nodejs-mobile-samples/52347086d7076d59cf663850b4debd33b17de089/android/native-gradle-node-folder/app/libnode/bin/x86/copy-libnode.so-here -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/bin/x86_64/copy-libnode.so-here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaneaSystems/nodejs-mobile-samples/52347086d7076d59cf663850b4debd33b17de089/android/native-gradle-node-folder/app/libnode/bin/x86_64/copy-libnode.so-here -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/android-ifaddrs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995, 1999 3 | * Berkeley Software Design, Inc. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND 12 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | * ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE 15 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 16 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 17 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 18 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 19 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 20 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 21 | * SUCH DAMAGE. 22 | * 23 | * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp 24 | */ 25 | 26 | #ifndef _IFADDRS_H_ 27 | #define _IFADDRS_H_ 28 | 29 | struct ifaddrs { 30 | struct ifaddrs *ifa_next; 31 | char *ifa_name; 32 | unsigned int ifa_flags; 33 | struct sockaddr *ifa_addr; 34 | struct sockaddr *ifa_netmask; 35 | struct sockaddr *ifa_dstaddr; 36 | void *ifa_data; 37 | }; 38 | 39 | /* 40 | * This may have been defined in . Note that if is 41 | * to be included it must be included before this header file. 42 | */ 43 | #ifndef ifa_broadaddr 44 | #define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ 45 | #endif 46 | 47 | #include 48 | 49 | __BEGIN_DECLS 50 | extern int getifaddrs(struct ifaddrs **ifap); 51 | extern void freeifaddrs(struct ifaddrs *ifa); 52 | __END_DECLS 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/chakra_ttd.h: -------------------------------------------------------------------------------- 1 | #ifndef SRC_CHAKRA_TTD_H_ 2 | #define SRC_CHAKRA_TTD_H_ 3 | 4 | #if defined(NODE_ENGINE_CHAKRACORE) 5 | #define ENABLE_TTD_NODE 1 6 | #else 7 | #define ENABLE_TTD_NODE 0 8 | #endif 9 | 10 | #if defined(ENABLE_TTD_NODE) && ENABLE_TTD_NODE 11 | extern bool s_doTTRecord; 12 | extern bool s_doTTReplay; 13 | extern bool s_doTTDebug; 14 | #endif 15 | 16 | #endif // SRC_CHAKRA_TTD_H_ 17 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/libplatform/libplatform-export.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ 6 | #define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ 7 | 8 | #if defined(_WIN32) 9 | 10 | #ifdef BUILDING_V8_PLATFORM_SHARED 11 | #define V8_PLATFORM_EXPORT __declspec(dllexport) 12 | #elif USING_V8_PLATFORM_SHARED 13 | #define V8_PLATFORM_EXPORT __declspec(dllimport) 14 | #else 15 | #define V8_PLATFORM_EXPORT 16 | #endif // BUILDING_V8_PLATFORM_SHARED 17 | 18 | #else // defined(_WIN32) 19 | 20 | // Setup for Linux shared library export. 21 | #ifdef BUILDING_V8_PLATFORM_SHARED 22 | #define V8_PLATFORM_EXPORT __attribute__((visibility("default"))) 23 | #else 24 | #define V8_PLATFORM_EXPORT 25 | #endif 26 | 27 | #endif // defined(_WIN32) 28 | 29 | #endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ 30 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | # define HEADER_EBCDIC_H 5 | 6 | # include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /* Avoid name clashes with other applications */ 13 | # define os_toascii _openssl_os_toascii 14 | # define os_toebcdic _openssl_os_toebcdic 15 | # define ebcdic2ascii _openssl_ebcdic2ascii 16 | # define ascii2ebcdic _openssl_ascii2ebcdic 17 | 18 | extern const unsigned char os_toascii[256]; 19 | extern const unsigned char os_toebcdic[256]; 20 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 21 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | # define HEADER_WHRLPOOL_H 3 | 4 | # include 5 | # include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | # define WHIRLPOOL_BBLOCK 512 13 | # define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | # ifndef OPENSSL_NO_WHIRLPOOL 27 | # ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | # endif 30 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 33 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 35 | # endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-aix.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_AIX_H 23 | #define UV_AIX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | int fs_fd; \ 27 | 28 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 29 | uv__io_t event_watcher; \ 30 | char *dir_filename; \ 31 | 32 | #endif /* UV_AIX_H */ 33 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-bsd.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_BSD_H 23 | #define UV_BSD_H 24 | 25 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 26 | uv__io_t event_watcher; \ 27 | 28 | #define UV_IO_PRIVATE_PLATFORM_FIELDS \ 29 | int rcount; \ 30 | int wcount; \ 31 | 32 | #define UV_HAVE_KQUEUE 1 33 | 34 | #endif /* UV_BSD_H */ 35 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-linux.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_LINUX_H 23 | #define UV_LINUX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | uv__io_t inotify_read_watcher; \ 27 | void* inotify_watchers; \ 28 | int inotify_fd; \ 29 | 30 | #define UV_PLATFORM_FS_EVENT_FIELDS \ 31 | void* watchers[2]; \ 32 | int wd; \ 33 | 34 | #endif /* UV_LINUX_H */ 35 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-os390.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_MVS_H 23 | #define UV_MVS_H 24 | 25 | #define UV_PLATFORM_SEM_T int 26 | 27 | #define UV_PLATFORM_LOOP_FIELDS \ 28 | void* ep; \ 29 | 30 | #endif /* UV_MVS_H */ 31 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-posix.h: -------------------------------------------------------------------------------- 1 | /* Copyright libuv project contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_POSIX_H 23 | #define UV_POSIX_H 24 | 25 | #define UV_PLATFORM_LOOP_FIELDS \ 26 | struct pollfd* poll_fds; \ 27 | size_t poll_fds_used; \ 28 | size_t poll_fds_size; \ 29 | unsigned char poll_fds_iterating; \ 30 | 31 | #endif /* UV_POSIX_H */ 32 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-sunos.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_SUNOS_H 23 | #define UV_SUNOS_H 24 | 25 | #include 26 | #include 27 | 28 | /* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c, 29 | * add the fs_event fields even when this version of SunOS doesn't support 30 | * file watching. 31 | */ 32 | #define UV_PLATFORM_LOOP_FIELDS \ 33 | uv__io_t fs_event_watcher; \ 34 | int fs_fd; \ 35 | 36 | #if defined(PORT_SOURCE_FILE) 37 | 38 | # define UV_PLATFORM_FS_EVENT_FIELDS \ 39 | file_obj_t fo; \ 40 | int fd; \ 41 | 42 | #endif /* defined(PORT_SOURCE_FILE) */ 43 | 44 | #endif /* UV_SUNOS_H */ 45 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-threadpool.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | /* 23 | * This file is private to libuv. It provides common functionality to both 24 | * Windows and Unix backends. 25 | */ 26 | 27 | #ifndef UV_THREADPOOL_H_ 28 | #define UV_THREADPOOL_H_ 29 | 30 | struct uv__work { 31 | void (*work)(struct uv__work *w); 32 | void (*done)(struct uv__work *w, int status); 33 | struct uv_loop_s* loop; 34 | void* wq[2]; 35 | }; 36 | 37 | #endif /* UV_THREADPOOL_H_ */ 38 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/uv-version.h: -------------------------------------------------------------------------------- 1 | /* Copyright Joyent, Inc. and other Node contributors. All rights reserved. 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to 5 | * deal in the Software without restriction, including without limitation the 6 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | * sell copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in 11 | * all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | * IN THE SOFTWARE. 20 | */ 21 | 22 | #ifndef UV_VERSION_H 23 | #define UV_VERSION_H 24 | 25 | /* 26 | * Versions with the same major number are ABI stable. API is allowed to 27 | * evolve between minor releases, but only in a backwards compatible way. 28 | * Make sure you update the -soname directives in configure.ac 29 | * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but 30 | * not UV_VERSION_PATCH.) 31 | */ 32 | 33 | #define UV_VERSION_MAJOR 1 34 | #define UV_VERSION_MINOR 14 35 | #define UV_VERSION_PATCH 1 36 | #define UV_VERSION_IS_RELEASE 1 37 | #define UV_VERSION_SUFFIX "" 38 | 39 | #define UV_VERSION_HEX ((UV_VERSION_MAJOR << 16) | \ 40 | (UV_VERSION_MINOR << 8) | \ 41 | (UV_VERSION_PATCH)) 42 | 43 | #endif /* UV_VERSION_H */ 44 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/v8-inspector-protocol.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_V8_INSPECTOR_PROTOCOL_H_ 6 | #define V8_V8_INSPECTOR_PROTOCOL_H_ 7 | 8 | #include "inspector/Debugger.h" // NOLINT(build/include) 9 | #include "inspector/Runtime.h" // NOLINT(build/include) 10 | #include "inspector/Schema.h" // NOLINT(build/include) 11 | #include "v8-inspector.h" // NOLINT(build/include) 12 | 13 | #endif // V8_V8_INSPECTOR_PROTOCOL_H_ 14 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/v8-testing.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_V8_TEST_H_ 6 | #define V8_V8_TEST_H_ 7 | 8 | #include "v8.h" // NOLINT(build/include) 9 | 10 | /** 11 | * Testing support for the V8 JavaScript engine. 12 | */ 13 | namespace v8 { 14 | 15 | class V8_EXPORT Testing { 16 | public: 17 | enum StressType { 18 | kStressTypeOpt, 19 | kStressTypeDeopt 20 | }; 21 | 22 | /** 23 | * Set the type of stressing to do. The default if not set is kStressTypeOpt. 24 | */ 25 | static void SetStressRunType(StressType type); 26 | 27 | /** 28 | * Get the number of runs of a given test that is required to get the full 29 | * stress coverage. 30 | */ 31 | static int GetStressRuns(); 32 | 33 | /** 34 | * Indicate the number of the run which is about to start. The value of run 35 | * should be between 0 and one less than the result from GetStressRuns() 36 | */ 37 | static void PrepareStressRun(int run); 38 | 39 | /** 40 | * Force deoptimization of all functions. 41 | */ 42 | static void DeoptimizeAll(Isolate* isolate); 43 | }; 44 | 45 | 46 | } // namespace v8 47 | 48 | #endif // V8_V8_TEST_H_ 49 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/v8-value-serializer-version.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /** 6 | * Compile-time constants. 7 | * 8 | * This header provides access to information about the value serializer at 9 | * compile time, without declaring or defining any symbols that require linking 10 | * to V8. 11 | */ 12 | 13 | #ifndef INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_ 14 | #define INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_ 15 | 16 | #include 17 | 18 | namespace v8 { 19 | 20 | constexpr uint32_t CurrentValueSerializerFormatVersion() { return 13; } 21 | 22 | } // namespace v8 23 | 24 | #endif // INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_ 25 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/v8-version-string.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_VERSION_STRING_H_ 6 | #define V8_VERSION_STRING_H_ 7 | 8 | #include "v8-version.h" // NOLINT(build/include) 9 | 10 | // This is here rather than v8-version.h to keep that file simple and 11 | // machine-processable. 12 | 13 | #if V8_IS_CANDIDATE_VERSION 14 | #define V8_CANDIDATE_STRING " (candidate)" 15 | #else 16 | #define V8_CANDIDATE_STRING "" 17 | #endif 18 | 19 | #define V8_SX(x) #x 20 | #define V8_S(x) V8_SX(x) 21 | 22 | #if V8_PATCH_LEVEL > 0 23 | #define V8_VERSION_STRING \ 24 | V8_S(V8_MAJOR_VERSION) \ 25 | "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \ 26 | V8_PATCH_LEVEL) V8_CANDIDATE_STRING 27 | #else 28 | #define V8_VERSION_STRING \ 29 | V8_S(V8_MAJOR_VERSION) \ 30 | "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) V8_CANDIDATE_STRING 31 | #endif 32 | 33 | #endif // V8_VERSION_STRING_H_ 34 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/libnode/include/node/v8-version.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 the V8 project authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef V8_INCLUDE_VERSION_H_ // V8_VERSION_H_ conflicts with src/version.h 6 | #define V8_INCLUDE_VERSION_H_ 7 | 8 | // These macros define the version number for the current version. 9 | // NOTE these macros are used by some of the tool scripts and the build 10 | // system so their names cannot be changed without changing the scripts. 11 | #define V8_MAJOR_VERSION 6 12 | #define V8_MINOR_VERSION 0 13 | #define V8_BUILD_NUMBER 287 14 | #define V8_PATCH_LEVEL 53 15 | 16 | // Use 1 for candidates and 0 otherwise. 17 | // (Boolean macro values are not supported by all preprocessors.) 18 | #define V8_IS_CANDIDATE_VERSION 0 19 | 20 | #endif // V8_INCLUDE_VERSION_H_ 21 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/src/main/assets/nodejs-project/main.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var leftPad = require('left-pad'); 3 | var versions_server = http.createServer( (request, response) => { 4 | response.end('Versions: ' + JSON.stringify(process.versions) + ' left-pad: ' + leftPad(42, 5, '0')); 5 | }); 6 | versions_server.listen(3000); 7 | console.log('The node project has started.'); 8 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/src/main/assets/nodejs-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "native-gradle-node-project", 3 | "version": "0.0.1", 4 | "description": "node part of the project", 5 | "main": "main.js", 6 | "author": "janeasystems", 7 | "license": "", 8 | "dependencies": { 9 | "left-pad": "1.3.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /android/native-gradle-node-folder/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 18 | 19 |

Starting engine.

20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /cordova/UseNativeModules/www/js/index.js: -------------------------------------------------------------------------------- 1 | var app = { 2 | 3 | initialize: function() { 4 | document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); 5 | }, 6 | 7 | onDeviceReady: function() { 8 | document.getElementById('callversionsbutton').onclick = function() { 9 | nodejs.channel.send('versions'); 10 | }; 11 | document.getElementById('callsqlite3button').onclick = function() { 12 | nodejs.channel.send('sqlite3'); 13 | }; 14 | document.getElementById('callsha3button').onclick = function() { 15 | nodejs.channel.send('sha3'); 16 | }; 17 | startNodeProject(); 18 | }, 19 | 20 | }; 21 | 22 | app.initialize(); 23 | 24 | function showMessage(msg) { 25 | document.getElementById('messageslog').innerHTML = '
' + msg ; 26 | } 27 | 28 | function channelListener(msg) { 29 | showMessage(msg); 30 | }; 31 | 32 | // This is the callback passed to 'nodejs.start()' to be notified if the Node.js 33 | // engine has started successfully. 34 | function startupCallback(err) { 35 | if (err) { 36 | console.log(err); 37 | showMessage(err); 38 | } else { 39 | console.log ('Node.js Mobile Engine started'); 40 | showMessage('Node.js Mobile Engine started'); 41 | } 42 | }; 43 | 44 | // The entry point to start the Node.js app. 45 | function startNodeProject() { 46 | nodejs.channel.setListener(channelListener); 47 | nodejs.start('main.js', startupCallback); 48 | }; 49 | -------------------------------------------------------------------------------- /cordova/UseNativeModules/www/nodejs-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs-mobile-use-native-modules-project", 3 | "version": "0.1.0", 4 | "description": "Node.js for Mobile Apps Use Native Modules project", 5 | "main": "main.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Janea Systems Inc.", 10 | "license": "MIT", 11 | "dependencies": { 12 | "sha3": "1.2.2", 13 | "sqlite3": "4.0.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | *.framework/ 25 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/NodeMobile/copy-NodeMobile.framework-here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaneaSystems/nodejs-mobile-samples/52347086d7076d59cf663850b4debd33b17de089/ios/native-xcode-node-folder/NodeMobile/copy-NodeMobile.framework-here -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // native-xcode-node-folder 4 | // 5 | // Created by Jaime Bernardo on 08/03/2018. 6 | // Copyright © 2018 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/NodeRunner.h: -------------------------------------------------------------------------------- 1 | // 2 | // NodeRunner.h 3 | // native-xcode-node-folder 4 | // 5 | // Created by Jaime Bernardo on 08/03/2018. 6 | // Copyright © 2018 Janea Systems. All rights reserved. 7 | // 8 | 9 | #ifndef NodeRunner_h 10 | #define NodeRunner_h 11 | #import 12 | 13 | @interface NodeRunner : NSObject {} 14 | + (void) startEngineWithArguments:(NSArray*)arguments; 15 | @end 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/NodeRunner.mm: -------------------------------------------------------------------------------- 1 | // 2 | // NodeRunner.mm 3 | // native-xcode-node-folder 4 | // 5 | // Created by Jaime Bernardo on 08/03/2018. 6 | // Copyright © 2018 Janea Systems. All rights reserved. 7 | // 8 | 9 | #include "NodeRunner.h" 10 | #include 11 | #include 12 | 13 | @implementation NodeRunner 14 | 15 | //node's libUV requires all arguments being on contiguous memory. 16 | + (void) startEngineWithArguments:(NSArray*)arguments 17 | { 18 | int c_arguments_size=0; 19 | 20 | //Compute byte size need for all arguments in contiguous memory. 21 | for (id argElement in arguments) 22 | { 23 | c_arguments_size+=strlen([argElement UTF8String]); 24 | c_arguments_size++; // for '\0' 25 | } 26 | 27 | //Stores arguments in contiguous memory. 28 | char* args_buffer=(char*)calloc(c_arguments_size, sizeof(char)); 29 | 30 | //argv to pass into node. 31 | char* argv[[arguments count]]; 32 | 33 | //To iterate through the expected start position of each argument in args_buffer. 34 | char* current_args_position=args_buffer; 35 | 36 | //Argc 37 | int argument_count=0; 38 | 39 | //Populate the args_buffer and argv. 40 | for (id argElement in arguments) 41 | { 42 | const char* current_argument=[argElement UTF8String]; 43 | 44 | //Copy current argument to its expected position in args_buffer 45 | strncpy(current_args_position, current_argument, strlen(current_argument)); 46 | 47 | //Save current argument start position in argv and increment argc. 48 | argv[argument_count]=current_args_position; 49 | argument_count++; 50 | 51 | //Increment to the next argument's expected position. 52 | current_args_position+=strlen(current_args_position)+1; 53 | } 54 | 55 | //Start node, with argc and argv. 56 | node_start(argument_count,argv); 57 | } 58 | @end 59 | 60 | 61 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // native-xcode-node-folder 4 | // 5 | // Created by Jaime Bernardo on 08/03/2018. 6 | // Copyright © 2018 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // native-xcode-node-folder 4 | // 5 | // Created by Jaime Bernardo on 08/03/2018. 6 | // Copyright © 2018 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | @property (weak, nonatomic) IBOutlet UIButton *myButton; 13 | @property (weak, nonatomic) IBOutlet UITextView *myTextView; 14 | 15 | - (IBAction)myButtonAction:(id)sender; 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view, typically from a nib. 23 | } 24 | 25 | - (IBAction)myButtonAction:(id)sender 26 | { 27 | NSString *localNodeServerURL = @"http:/127.0.0.1:3000/"; 28 | NSURL *url = [NSURL URLWithString:localNodeServerURL]; 29 | NSString *versionsData = [NSString stringWithContentsOfURL:url]; 30 | if (versionsData) 31 | { 32 | [_myTextView setText:versionsData]; 33 | } 34 | 35 | } 36 | 37 | - (void)didReceiveMemoryWarning { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/native-xcode-node-folder/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // native-xcode-node-folder 4 | // 5 | // Created by Jaime Bernardo on 08/03/2018. 6 | // Copyright © 2018 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/nodejs-project/main.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var leftPad = require('left-pad'); 3 | var versions_server = http.createServer( (request, response) => { 4 | response.end('Versions: ' + JSON.stringify(process.versions) + ' left-pad: ' + leftPad(42, 5, '0')); 5 | }); 6 | versions_server.listen(3000); 7 | -------------------------------------------------------------------------------- /ios/native-xcode-node-folder/nodejs-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "native-xcode-node-project", 3 | "version": "0.0.1", 4 | "description": "node part of the project", 5 | "main": "main.js", 6 | "author": "janeasystems", 7 | "license": "", 8 | "dependencies": { 9 | "left-pad": "1.3.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ios/native-xcode/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | *.framework/ 25 | -------------------------------------------------------------------------------- /ios/native-xcode/libnode/copy-libnode.framework-here: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JaneaSystems/nodejs-mobile-samples/52347086d7076d59cf663850b4debd33b17de089/ios/native-xcode/libnode/copy-libnode.framework-here -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // native-xcode 4 | // 5 | // Created by Jaime Bernardo on 29/09/2017. 6 | // Copyright © 2017 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/NodeRunner.h: -------------------------------------------------------------------------------- 1 | // 2 | // NodeRunner.h 3 | // native-xcode 4 | // 5 | // Created by Jaime Bernardo on 29/09/2017. 6 | // Copyright © 2017 Janea Systems. All rights reserved. 7 | // 8 | 9 | #ifndef NodeRunner_h 10 | #define NodeRunner_h 11 | #import 12 | 13 | @interface NodeRunner : NSObject {} 14 | + (void) startEngineWithArguments:(NSArray*)arguments; 15 | @end 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/NodeRunner.mm: -------------------------------------------------------------------------------- 1 | // 2 | // NodeRunner.m 3 | // native-xcode 4 | // 5 | // Created by Jaime Bernardo on 29/09/2017. 6 | // Copyright © 2017 Janea Systems. All rights reserved. 7 | // 8 | 9 | #include "NodeRunner.h" 10 | #include 11 | #include 12 | 13 | @implementation NodeRunner 14 | 15 | //node's libUV requires all arguments being on contiguous memory. 16 | + (void) startEngineWithArguments:(NSArray*)arguments 17 | { 18 | int c_arguments_size=0; 19 | 20 | //Compute byte size need for all arguments in contiguous memory. 21 | for (id argElement in arguments) 22 | { 23 | c_arguments_size+=strlen([argElement UTF8String]); 24 | c_arguments_size++; // for '\0' 25 | } 26 | 27 | //Stores arguments in contiguous memory. 28 | char* args_buffer=(char*)calloc(c_arguments_size, sizeof(char)); 29 | 30 | //argv to pass into node. 31 | char* argv[[arguments count]]; 32 | 33 | //To iterate through the expected start position of each argument in args_buffer. 34 | char* current_args_position=args_buffer; 35 | 36 | //Argc 37 | int argument_count=0; 38 | 39 | //Populate the args_buffer and argv. 40 | for (id argElement in arguments) 41 | { 42 | const char* current_argument=[argElement UTF8String]; 43 | 44 | //Copy current argument to its expected position in args_buffer 45 | strncpy(current_args_position, current_argument, strlen(current_argument)); 46 | 47 | //Save current argument start position in argv and increment argc. 48 | argv[argument_count]=current_args_position; 49 | argument_count++; 50 | 51 | //Increment to the next argument's expected position. 52 | current_args_position+=strlen(current_args_position)+1; 53 | } 54 | 55 | //Start node, with argc and argv. 56 | node_start(argument_count,argv); 57 | } 58 | @end 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // native-xcode 4 | // 5 | // Created by Jaime Bernardo on 29/09/2017. 6 | // Copyright © 2017 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // native-xcode 4 | // 5 | // Created by Jaime Bernardo on 29/09/2017. 6 | // Copyright © 2017 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | @property (weak, nonatomic) IBOutlet UIButton *myButton; 13 | @property (weak, nonatomic) IBOutlet UITextView *myTextView; 14 | 15 | - (IBAction)myButtonAction:(id)sender; 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view, typically from a nib. 23 | } 24 | 25 | - (IBAction)myButtonAction:(id)sender 26 | { 27 | NSString *localNodeServerURL = @"http:/127.0.0.1:3000/"; 28 | NSURL *url = [NSURL URLWithString:localNodeServerURL]; 29 | NSString *versionsData = [NSString stringWithContentsOfURL:url]; 30 | if (versionsData) 31 | { 32 | [_myTextView setText:versionsData]; 33 | } 34 | 35 | } 36 | 37 | - (void)didReceiveMemoryWarning { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ios/native-xcode/native-xcode/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // native-xcode 4 | // 5 | // Created by Jaime Bernardo on 29/09/2017. 6 | // Copyright © 2017 Janea Systems. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /react-native/SuspendResume/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /react-native/SuspendResume/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /react-native/SuspendResume/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | 34 | munge_underscores=true 35 | 36 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 37 | 38 | module.file_ext=.js 39 | module.file_ext=.jsx 40 | module.file_ext=.json 41 | module.file_ext=.native.js 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 52 | 53 | unsafe.enable_getters_and_setters=true 54 | 55 | [version] 56 | ^0.61.0 57 | -------------------------------------------------------------------------------- /react-native/SuspendResume/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /react-native/SuspendResume/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | -------------------------------------------------------------------------------- /react-native/SuspendResume/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /react-native/SuspendResume/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | Platform, 10 | StyleSheet, 11 | Text, 12 | Button, 13 | AppState, 14 | View 15 | } from 'react-native'; 16 | 17 | import nodejs from 'nodejs-mobile-react-native'; 18 | 19 | export default class App extends Component<{}> { 20 | constructor(props){ 21 | super(props); 22 | this.state = { lastNodeMessage: "No message yet." }; 23 | this.listenerRef = null; 24 | } 25 | componentWillMount() 26 | { 27 | nodejs.start('main.js'); 28 | this.listenerRef = ((msg) => { 29 | this.setState({lastNodeMessage: msg}); 30 | }); 31 | nodejs.channel.addListener( 32 | "message", 33 | this.listenerRef, 34 | this 35 | ); 36 | } 37 | componentWillUnmount() 38 | { 39 | if (this.listenerRef) { 40 | nodejs.channel.removeListener("message", this.listenerRef); 41 | } 42 | } 43 | componentDidMount(){ 44 | AppState.addEventListener('change', (state) => { 45 | if (state === 'active') { 46 | nodejs.channel.send('resume'); 47 | } 48 | if (state === 'background') { 49 | nodejs.channel.send('suspend'); 50 | } 51 | }); 52 | } 53 | render() { 54 | return ( 55 | 56 |