Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MobileDevice NodObjC basic example.
var $ = require('NodObjC')
// Callback function that's invoked when a device is plugged in
function callback (info, foo) {
try {
console.log('inside callback!')
var i = new $.am_device_notification_callback_info(info)
if (i.msg == $.ADNCI_MSG_CONNECTED) {
} else {
} catch (e) {
console.error(e.stack || e)
// create an instance of am_device_notification
var notif = new $.am_device_notification()
// listen for device notifications
$.AMDeviceNotificationSubscribe(callback, 0, 0, null, notif.ref());
console.error('beginning RunLoop')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment