Determine whether the device can dial

You must Login before you can answer or comment on any questions.

Does anyone know if it's possible to determine in Titanium if the device is able to make phone calls (like an iPhone) or not (like a wifi-only Android tablet)? I know how to make a call, but don't want to offer this if the device can't place calls.

— asked 9 months ago by Mark Ruys
0 Comments

1 Answer

Accepted Answer

This module should help on IOS

TiNetworkHelpers

— answered 9 months ago by Aaron Saunders
answer permalink
1 Comment
  • Indeed, using this module, I'm able to determine whether I can place calls. This is the code I used:

    var benCodingNetwork = require('bencoding.network');
    var carrierInfo = benCodingNetwork.createCarrierInfo();
    var hasMobileNetwork = carrierInfo.mobileNetworkCode != 'unknown' && carrierInfo.mobileNetworkCode != '';
    This handles the case that the device has no GSM unit, and the case no SIM card is inserted.

    For Android it obviously won't work. Also make sure you add 'iOS Network Helpers' from the marketplace to your products to prevent a licensing error upon start of your app.

    Thanks Aaron!

    — commented 9 months ago by Mark Ruys

Your Answer

Think you can help? Login to answer this question!