Detecting iOS BLE advertising on Android - React Native BLE Advertiser - react-native

I've been using react-native-ble-advertiser to try and send string data (the broadcast uuid) between phones, I've managed to get these sharing compatabilities
iOS to iOS 2-way
Android to Android 2-way
Android to iOS 1-way
I'm wondering if perhaps I missed something for BLE as when I try to advertise on iOS I get the warning The advertisement key 'Manufacturer Data' is not allowed in CoreBluetooth however as I said I can detect iOS to iOS.
Is there any way to detect iOS on Android?
Below is my configuration taken from the example on the github link above.
The scanning and broadcasting is done at the same time, though I tested without this and still had the issue.
const MANUF_DATA = [1, 0];
BLEAdvertiser.setCompanyId(0x4C);
BLEAdvertiser.broadcast(hash_uuid, MANUF_DATA, {
advertiseMode: BLEAdvertiser.ADVERTISE_MODE_BALANCED,
txPowerLevel: BLEAdvertiser.ADVERTISE_TX_POWER_MEDIUM,
...
})
BLEAdvertiser.scan(MANUF_DATA, {
scanMode: BLEAdvertiser.SCAN_MODE_LOW_LATENCY,
})
Does anyone have experience with this package or know of a better way to transmit a string? Open to posting the native code from the package.
Thanks.

Contacted the package developer and it is a known issue with iOS and Apple blocking adjusting CoreBluetooth manufacturer data (the package needs this to scan properly)
"Unfortunately, Apple keeps finding ways to break the advertiser. A few months ago, they started blocking the use of manufacturer data that makes the phone visible to Android and we have not been able to find a way around it yet."
Will continue to resolve this on my own and update if I get a solution or the package is updated :)
Update 1 (temp fix): You can set the filters to null in BLEAdvertiserModule in the package. Allowing Android to find iOS manufacturer code. See my github issue resolution here
Update 2: Merged PR so you can now just use the package straight from npm to do phone to phone scans :) There are some comments in example>app>entry.js to show how to set up Android to iPhone scanning :)

Related

Get device location periodically, even if app is killed

I can't seem to find any supporting documentation in the Expo docs or React Native docs that say whether or not this is possible, so I figured I'd ask here.
I'm creating an app that needs to periodically fetch the device's location, whether the app is in the foreground, background, but most important even if it's killed. Even a few times an hour is fine.
Do both Android and iOS even support this behaviour? And if so, can someone point me in the right direction or provide the class/API that I would need to make use of in Expo/React Native (ideally in Expo) that would allow me to fetch the device's location periodically even if the app is killed?
Thank you!
Generally speaking, yes, it should be possible.
On Android, this is generally possible using a Broadcast Reciever (and see the information there regarding getting user's location up from API 28).
On iOS, this is specifically possible using the Standard Location Service (specifically refer to the section "Getting Location Events in the Background").
Focusing on React Native, then again - focusing on Expo, there is a recent post discussing just that:
The best way of tracking location in background using react-native + Expo in 2020. However, the comments there indicate that it doesn't work consistently.
Therefore, since I understand you don't specifically require using Expo (you just say "ideally in Expo" :), you can try following this React Native tutorial (June 2021): React Native background location (background & terminated app) (it uses react-native-location library).
It seems that this could be exactly what you're looking for:
React Native — Background Location Tracking without Timeout and with App killed
https://itnext.io/react-native-background-location-tracking-without-timeout-and-with-app-killed-3dbfbc80ad01

iOS 10 Toggle On/Off programmatically 3G/4G data with Private API

So I got a client asking for a way to programmatically reset the data connection of his iPhone. The app won't go to the Appstore so any help is welcome.
There is two possibility but each one does involve Private API uses :
• Toggle 3G/4G On/Off
• Toggle AirPlane mode On/Off
The question is simple :
How to use the Private API to get the wanted result ?
With probability of 95% you won't be able to do that. Apple closed most of private APIs as of iOS 8.4. For education purposes, you could take a look at the iOS runtime headers for iOS 10.1 just to see what's no longer available.
Moreover, as of Xcode 7 you can't even link the private frameworks inside an app that easily - be it for AppStore or AdHoc.
So even if the client device is using a jailbreak, you won't be able to achieve it.
What you could do though - is write a jailbreak tweak and post it to Cydia, or somehow call an existing preinstalled tweak from inside your app on a jailbroken device - though I've never heard anyone do that.

WiFi scan data is not working in android M

I want to develop WiFi scan app. The app is working fine in below android M. Above android M, I used ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION its working fine if I switch ON my GPS. If I switch off my location the WiFi scan is not working Please help me to solve this problem.
Starting from Android 6.0, GPS must be enabled to get any results from wifi scans.
You can check this thread (https://code.google.com/p/android/issues/detail?id=185370) for further information. It appears it is an intended behaviour:
Thanks for the suggestion. Our development team has looked into this bug and decided that it is working as per the design.
WifiManager#getScanResults() returns an empty list if location is turned off for the device.
It sucks, I agree, but that's how it is for now.

using firebase geofire in IOS App

I am to looking for a quick way to implement a dynamic location based filtering of points of interest feature in an iOS App - where a user's location continuously changes and as a result the points of interest will continuously change.
I see that firebase geofire has a similar feature but written in .js. Can you advise if this can be leveraged in an iOS App with no webviews?
GeoFire now has an Objective-C library!

Sencha touch 2.0, android app keeps showing loading screen forever on certain devices

I've finished writing my first Sencha app and released it in Android market place. This is basically for a conference being held in Metro Detroit Area next week. I'm also introducing Sencha in my company as a viable mobile option.
However once released into the market, it does not seem to load on certain devices. How to find out what is wrong on the device? It works great on desk top and also on certain android phones and nexus pad but does not load ( the user keeps seeing the loading page for ever) in certain other phones. I would like to know how to debug this issue? Does Sencha log the console log exceptions in logcat? Any help in this direction is highly
appreciated!
I'm using Internet permissions to access twitter feed and google maps. Kind of guessing that the issue could be because of accessing Internet but how to find that out?
Thanks
From experience, this is generally due to javascript errors before sencha has been properly set up. This can be missing functionality or include issues, picky parsers etc. There is no real good way to debug this more than to get ahold of an affected device and set window.error = alert before any other javascript is run.