Does CTCarrier mobileNetworkCode change when roaming? - ios

The documentation states for CTCarrier's carrierName "The value does not change if the user is roaming; it always represents the provider with whom the user has an account."
It does not say the same about mobileNetworkCode however. Does this change based on the current carrier or does it remain constant too?
I am trying find if the phone is roaming in a startMonitoringSignificantLocationChanges callback so would like to avoid geolocating.

I'm roaming right now - in Switzerland on an AT&T iPhone 4 on Swisscom. Just wrote a quick program to test. Here's what I got:
2011-04-29 09:01:55.657 test[2094:707] Carrier Name: AT&T
2011-04-29 09:01:55.665 test[2094:707] ISO Country Code: us
2011-04-29 09:01:55.669 test[2094:707] Mobile Country Code: 310
2011-04-29 09:01:55.678 test[2094:707] Mobile Network Code: 410
So, to answer your question, doesn't look like mobile network code changes (410 is AT&T as cited below)

Related

Enroll MCCGQ12LM (Aqara Door & Window Sensor T1)

Has anyone successfully enrolled a MCCGQ12LM into a custom coordiantor? I would love to look at some logs, or get some guidelines.
I'm trying to enroll my MCCGQ12LM into my CIE, and after writing the CIE address to the CIE Address attribute, i get the ZoneEnrollRequest which i reply with a ZoneEnrollReponse. Everything seems to look correct on wireshark:
[Zone Enroll Request][1]
[1]: https://i.stack.imgur.com/wUwwe.png
[Zone Enroll Response][2]
[2]: https://i.stack.imgur.com/jX5cR.png
But if i read the ZoneState attribute afterwards, it is still marked as Value: 0x00 [NotEnrolled].
The same process has been tested on a Samsung Multisensor, and works perfectly.
Thank you
I figured it out, you have to include a payload in the Zone Enroll Response, with the Enroll Response code, and the Zone ID.

Is the new Altbeacon Lib. v2.16.2 supporting Android "O" Scannable API?

In Android API level 26, "setScannable" is added.
"setScannable" Added in API level 26
public AdvertisingSetParameters.Builder setScannable (boolean scannable)
Set whether the advertisement type should be scannable. Legacy advertisements can be both connectable and scannable. Non-legacy advertisements can be only scannable or only connectable.
I am creating a beacon and want to set it non-scannable mode.
Just wondering if the latest Altbeacon Lib. v2.16.2 support this setting? If not, is there a way to use Android API and Altbeacon Lib. together to set a beacon's advertising parameters?
Thanks!
Tried Altbeacon Lib. v2.15.2, it seems that Android API level 26 is not support, which means that "setScannable" is not available.
String id1 = "3b710c27-acf7-4225-8753-4aca354f5bec"; // UUID
String id2 = "1";
String id3 = "2";
Beacon beacon = new Beacon.Builder()
.setId1(id1)
.setId2(id2)
.setId3(id3)
.setManufacturer(0x01F1)
.setTxPower(iTxPower)
.setDataFields(Arrays.asList(new Long[] {0l}))
.build();
BeaconParser beaconParser = new BeaconParser().
setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25");
BeaconTransmitter beaconTransmitter = new
BeaconTransmitter(getApplicationContext(), beaconParser);
beaconTransmitter.startAdvertising(beacon);
...
I would hope Altbeacon Lib. v2.16.2 could support Android API Level 26 so that "setScannable" is supported.
There is no such configuration ability in the 2.16.2 version of the library. It is logged as a feature request here:
https://github.com/AltBeacon/android-beacon-library/issues/813
This would not be difficult to add if you would like to work on that feature request. Please comment on that linked page above, if so, and I can give you guidance on what to do.

iOS failing to render vcf file

I use twilio to share contact information of my users. I've been doing this for 6 months with no problems.
Recently, I started receiving bug reports that the contact card isn't coming through. iOS is receiving it as an unknown attachment with a file name such as 'text_0.x-vcard' [see screenshot]
I'm unable to reproduce this on my device - I've received reports of this from users with an iPhone 7, iPhone 6, and iPhone 5 - nothing consistent. No consistency in OS either. The vcf file is valid, and it works for 90% of users.
Any ideas? Here is an example of a vcf file - works on my phone, doesn't work on one of the other devices.
BEGIN:VCARD
VERSION:3.0
N:Doe;John;;;
FN:John Doe
ORG:Example.com Inc.;
TITLE:Imaginary test person
EMAIL;type=INTERNET;type=WORK;type=pref:johnDoe#example.org
TEL;type=WORK;type=pref:+1 617 555 1212
TEL;type=WORK:+1 (617) 555-1234
TEL;type=CELL:+1 781 555 1212
TEL;type=HOME:+1 202 555 1212
item1.ADR;type=WORK:;;2 Enterprise Avenue;Worktown;NY;01111;USA
item1.X-ABADR:us
item2.ADR;type=HOME;type=pref:;;3 Acacia Avenue;Hoemtown;MA;02222;USA
item2.X-ABADR:us
NOTE:John Doe has a long and varied history\, being documented on more police files that anyone else. Reports of his death are alas numerous.
item3.URL;type=pref:http\://www.example/com/doe
item3.X-ABLabel:_$!<HomePage>!$_
item4.URL:http\://www.example.com/Joe/foaf.df
item4.X-ABLabel:FOAF
item5.X-ABRELATEDNAMES;type=pref:Jane Doe
item5.X-ABLabel:_$!<Friend>!$_
CATEGORIES:Work,Test group
X-ABUID:5AD380FD-B2DE-4261-BA99-DE1D1DB52FBE\:ABPerson
END:VCARD
Steph,
I'm new to Stack Exchange, so I don't know how else to send this. You show one of your Twilio numbers above.
I am seeing similar issues, and I believe it is all related to your content type. Try a
curl --head <your vcard web address>
The only time I've had it work for me is when the it returned
Content-Type: text/x-vcard; charset=utf-8; name="fileName.vcf"
I don't know how long this link will last but try sending this vcard VCF File (Send from http address), it works for me on Twilio w/ iOS 10.3.3
I think your right about it being related to security; why would you want a 'text/html' file being being executed like a 'text/x-vcard' file. I don't think internal header modifiers will work, let me know.

Determine country code for iOS Region "Europe"

I am working on an app which asks users for phone number and has a country picker, where the user should input country code.
But while testing null country code values, I found out that somehow my iPhone with iOS 10.2.1 has a region format set to Europe.
The Europe region does not exist in the regions list when I search for it.
When I try to get the current locale country code
NSLocale *currentLocale = [NSLocale currentLocale];
return [currentLocale objectForKey:NSLocaleCountryCode]
I get en_150 which is not useful to determine user's country, at least on my device. Returned country code is 150, which does not exist.
I found a workaround to find to country code by using CTTelephonyNetworkInfo
if(![currentLocale objectForKey:NSLocaleCountryCode]) {
CTCarrier *carrier = [[CTTelephonyNetworkInfo new] subscriberCellularProvider];
NSString *countryCode = carrier.isoCountryCode;
return [countryCode capitalizedString];
}
But how does it work with this Europe locale and why do I have it set like this?
First of all, Europe is a continent not a country. It doesn’t have a country code. It does, however, have a region code. That region code is indeed 150.
Continents have numeric area codes instead including 001 for “World” and 150 for “Europe”.
Be sure to read my article “Are there standard language codes for ‘World English’ and ‘European English’” for a much more detailed explanation. These codes are based in UN M.49, which is the basis for ISO 3166, which is the standard you’re probably thinking of when you say “country codes”.
The problem you’re facing is that you can’t use someone’s language or formatting preferences to determine their physical location. My current device’s locale is en_DK but my physical location is NO. Many devices default to en_US and users all over the world never change the default settings.
Please use CoreLocation to automatically determine the user’s location, or just ask the user to disclose their location.

How to read magnetic card data?

I work with the magnetic card reader "MiniMag II" (ref. IDMB-334133B and datasheet here) on Windows 7. A driver has ben automatically installed, adding the card reader as a standard input device to Windows recognized devices.
When I swipe a card in the reader, card data is sent to the pc and written in the current window.
My problem concerns the card data format : I receive strings such as "méà(è&('&_é"(à&&à=àààààààààààààààààààà§", do you recognize a format here ?
I am not aware of the exact data format, but I know that the following numbers are included in their corresponding card data :
412835 : méà(è&'&é_"(à"&é-=&çà"'àçà(&àààààààààà§
418559 : méà(è&'&_((çà'&&-=&(&à'&'&à&àààààààààà§
2989449 : méà(è&éç_ç''çà&&à=àààààààààààààààààààà§
5418235 : méà(è&('&_é"(à&&à=àààààààààààààààààààà§
Do you have any lead to help me to understand how the received card data is built ?
Thank you
I found the solution, my system was in AZERTY mode and the reader input me QWERTY data... so when I changed the settings I have obtained the numbers I was looking for. Hope it can help someone.

Resources