What is Titanium.Geolocation.lastGeolocation in Titanium? - titanium

In Titanium there is the following property:
Titanium.Geolocation.lastGeolocation
As explained in this doc: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Geolocation
It is described as follows:
JSON representation of the last geolocation received.
LastEvent is the JSON version of the last geolocation sent by the OS.
This does not trigger a geolocation attempt, nor wait for such. If no
geolocation has happened, this value may be null or undefined.
My question is when it says "lastGeolocation", does it mean the last geolocation recieved my the device ever (e.g. The app could have got a location from another app such as Google Maps), or just the last geolocation received by the app?

I believe it should be the device's last location irrespective to which app requested for it.
It is easily checkable with following steps:
Get a fresh current location from the Titanium app & check the value of lastLocation.
Do a location request from another place with different app like Google Maps.
Then check it again in Titanium app.

Related

How to publish LocalScreenShare tracks from IOS to Web browser in React-Native using Twilio

I want to integrate Screen Share feature in my react-native application in which I am using Twilio for video communication. In Web we are able to achieve this by following these steps.
1 : We get the media device stream using
navigator.mediaDevices.getDisplayMedia({
video: true,
});
2 : Then we get the first stream tracks using
const newScreenTrack = first(stream.getVideoTracks());
3 : After that we set this newScreenTrack in some useState
const localScreenTrack = new TwilioVideo.LocalVideoTrack(
newScreenTrack
);
4 : After that we first unpublish the previous tracks and publish the new tracks using
videoRoom.localParticipant.publishTrack(newScreenTrack, {
name: "screen_share",
});
5 : And finally we pass these tracks in our ScreenShare component and render these tracks to View the screenShare from remote Participant.
I need to do the same thing in my react-native application as well. Where if localParticipant ask for screenShare permission to another participant. Participant will accept the permission and able to publish the localScreenShare tracks.
If anyone know this please help me in this. It would be really helpful. Thank you
I think this is an issue with the react-native-twilio-video-webrtc package. It seems that, as you discovered in this issue, that screen sharing was previously a feature of the library and it was removed as part of a refactor.
Sadly, the library does more work than the underlying Twilio libraries to look after the video and audio tracks. The Twilio library is built to be able to publish more than one track at a time, however this React Native library allows you to publish a single audio track and a single video track using the camera at a time.
In order to add screen sharing, you can either support pull requests like this one or refactor the library to separate getting access to the camera from publishing a video track, so that you can publish multiple video tracks at a time, including screen tracks.

react native background geolocation

I have a requirement to save user's geolocation when react-native app is running in background. I know react-native-background-geolocation is available for this but I don't want to use any third party tool for this. Is there a way I can fetch users current location even if the app is running in the background?
With the last Expo SDK 32 you should be able to to it.
We’re excited to announce that this release includes initial support for background location, a highly requested feature from many Expo users. You can now define simple JavaScript tasks in your app and register them to receive location updates in the background. Additionally, you can set up geofencing tasks that are triggered when the device enters or leaves specific geographic regions

How to know app was installed through firebase dynamic link in didFinishLaunchingWithOptions?

I am implementing firebase dynamic links in my iOS app and I can already parse the link, redirect to AppStore etc. Now I want to distinguish the first run of the app, when user installs it from the dynamic link - I want to skip the intro and show him the content that is expected to be shown.
Is there a way to know how the app is opened before being in didFinishLaunchingWithOptions?
The method application:openURL:options: will be called when Firebase Dynamic Links iOS SDK finished retrieving the pending (deferred) dynamic link.
If pending dynamic link is found, the object [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url] will have non-nil property url. The url will be equal to your deep link, that user tapped while your App was not installed. If link is not found, this property will be nil.
I suggest you to show "loading screen" in your didFinishLaunchingWithOptions. When Firebase Dynamic Links SDK will pass you result, you can proceed with custom onboarding if pending dynamic link is found. Or default onboarding if pending dynamic link is not found. Keep in mind, if network is slow, this may take some time. You may want to have timeout set to X seconds, to not hold your user too long at "loading screen".
Documentation about receiving Firebase Dynamic Links on iOS https://firebase.google.com/docs/dynamic-links/ios/receive

Onesignal making user appear 'active' every hour

I am currently segmenting users by a location filter. However the location is only updated if the mobile app is in foreground. Is there a way to mimic the user's last activity / currently location every hour even if the app is in the background? I am currently using React Native.
You can update the player / user record with the last location through the REST API by sending lat and long.
https://documentation.onesignal.com/reference#edit-device
You will need to use a plugin or your own native code to get the location of the device in the background.

Request ID is not available when App Launches after clicking Facebook notification

A Facebook app is setup with iOS native app enabled with bundle id and App Store Id of another app.
Following are possible in the current scenario.
1.Sending an app request to a friend,
2.The request badge appears in the friend's Facebook,
3. And clicking on the request launches my app.
This was the link i referred to implement this.
https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/#protip3
I am supposed to get a NSURL from these functions
– application:openURL:sourceApplication:annotation:
OR
– application:handleOpenURL:
and the expected format is as follows.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/[APP_NAME_SPACE]/?request_ids=
[COMMA_SEPARATED_REQUESTIDs]&ref=notif&app_request_type=user_to_user
Here the request_ids contains The id of app request send, and which can be used to get the data attached to the App Request.
Now my issue is that, I am not getting the NSURL in expected form, instead I get the following format. So I am unable to find or use the request_ids.
fb[APP_ID]://authorize#expires_in=[ACCESS_TOKEN_EXPIRATION]
&access_token=[USER_ACCESS_TOKEN]
&target_url=https://apps.facebook.com/application.php?id=442634372448098