Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniffi React Native Integration #401

Merged
merged 45 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b08a438
Initial uniffi setup
bjtrounson Dec 19, 2024
b6f97a3
Initial FerrostarCore and Route Provider implementation
bjtrounson Dec 20, 2024
a9fa7d1
FerrostarCore mostly done but without the location provider and spoke…
bjtrounson Dec 21, 2024
ae1feff
Location Provider Implementation
bjtrounson Dec 21, 2024
44f8ad6
intergration of LocationProvider into FerrostarCore
bjtrounson Dec 21, 2024
6721cec
Event listener for navigation state so we can since the external Ferr…
bjtrounson Dec 21, 2024
621ce74
Early NavigationView
bjtrounson Dec 21, 2024
f419c1f
Working FerrostarCore
bjtrounson Dec 22, 2024
9e74c58
Initial views and UI
bjtrounson Dec 22, 2024
a551b25
Working puck and trip progress view with formatters
bjtrounson Dec 23, 2024
a3ec716
typo fixes
bjtrounson Dec 23, 2024
fa218d4
forgot one word in typo check
bjtrounson Dec 23, 2024
56ae448
added icons
bjtrounson Dec 25, 2024
4217567
changed TripProgressView styling
bjtrounson Dec 25, 2024
6d99b4c
Added InstructionView
bjtrounson Dec 25, 2024
1d1796a
fix navigation camera to have pitch and zoom
bjtrounson Dec 25, 2024
981c007
fix icons names
bjtrounson Dec 26, 2024
eb250ea
change some styling in the instruction view
bjtrounson Dec 26, 2024
b5ccf0b
fix the estimatedArrival time
bjtrounson Dec 26, 2024
db63261
Add initial map control till needs onPress handlers
bjtrounson Dec 26, 2024
8b67143
chore: update and install new deps
bjtrounson Jan 16, 2025
3417e4a
feat: add example app with dotenv
bjtrounson Jan 16, 2025
714eebb
chore: add location permissions to example app
bjtrounson Jan 16, 2025
94d354f
fix: handling location edge cases
bjtrounson Jan 16, 2025
cb19e4e
feat: add map control events and state
bjtrounson Jan 16, 2025
927b614
chore: remove deprecated setAccessToken from default export
bjtrounson Jan 16, 2025
d0112eb
feat: add more icons and improve icons on other elements
bjtrounson Jan 16, 2025
49120af
Trying to fix camera issues when route focus
bjtrounson Jan 16, 2025
eeabe48
Update react-native/android/build.gradle
bjtrounson Jan 21, 2025
fcd3a89
chore: delete auto-generated code
bjtrounson Jan 21, 2025
2478e2a
chore: add auto-generated code to .gitignore
bjtrounson Jan 21, 2025
442a4a9
chore: update package.json for new license and ts for new imports
bjtrounson Jan 21, 2025
008d247
Update react-native/src/core/FerrostarCore.ts
bjtrounson Jan 21, 2025
2eae9a0
changed fastestInterval to 1000 as suggested
bjtrounson Jan 21, 2025
227366a
Merge branch 'react-native' of https://github.com/bjtrounson/ferrosta…
bjtrounson Jan 21, 2025
a973eaa
Update react-native/example/ios/FerrostarExample/Info.plist
bjtrounson Jan 21, 2025
e195139
Add JSDoc link to comments since syntax is different to Android
bjtrounson Jan 21, 2025
1b2e953
Changed the AndroidManifest that build.gradle is pointing at
bjtrounson Jan 21, 2025
1846a91
Revert back the AndroidManifestNew.xml since it's used for better com…
bjtrounson Jan 21, 2025
d846537
Update the example README.md with some helpful information
bjtrounson Jan 27, 2025
8b004e6
Add to the .gitignore
bjtrounson Jan 27, 2025
4181e5d
added package name to auto-generation and build.gradle
bjtrounson Jan 28, 2025
69addcc
remove CMakeList.txt and AndroidManifest.xml since they are auto-gene…
bjtrounson Jan 28, 2025
f5f2ade
correct AndroidManifest.xml ignore
bjtrounson Jan 28, 2025
779e3b8
Add TripState extensions as utils functions and apply them to the Nav…
bjtrounson Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add JSDoc link to comments since syntax is different to Android
bjtrounson committed Jan 21, 2025
commit e195139c6ada3d94ff703c8f0bd235c7907db918
10 changes: 5 additions & 5 deletions react-native/src/core/FerrostarCore.ts
Original file line number Diff line number Diff line change
@@ -73,9 +73,9 @@ export class NavigationState {
* the navigation with location updates and other events.
*
* The usual flow is for callers to configure an instance of the core reuse the instance for as long
* as it makes sense (necessarily somewhat app-specific). You can first call [getRoutes] to fetch a
* as it makes sense (necessarily somewhat app-specific). You can first call {@link getRoutes} to fetch a
* list of possible routes asynchronously. After selecting a suitable route (either interactively by
* the user or programmatically), call [startNavigation] to start a session.
* the user or programmatically), call {@link startNavigation} to start a session.
*
* NOTE: It is the responsibility of the caller to ensure that the location manager is authorized to
* access the user's location.
@@ -98,7 +98,7 @@ export class FerrostarCore implements LocationUpdateListener {
* Controls what happens when the user deviates from the route.
*
* The default behavior (when this property is `null`) is to fetch new routes automatically. These
* will be passed to the [alternativeRouteProcessor] or, if none is specified, navigation will
* will be passed to the {@link AlternativeRouteProcessor} or, if none is specified, navigation will
* automatically proceed according to the first route.
*/
deviationHandler?: RouteDeviationHandler;
@@ -108,7 +108,7 @@ export class FerrostarCore implements LocationUpdateListener {
*
* The default behavior (when this property is `null`) is to automatically reroute the user when
* an alternative route arrives due to the user being off course. In all other cases, no action
* will be taken unless an [AlternativeRouteProcessor] is provided.
* will be taken unless an {@link AlternativeRouteProcessor} is provided.
*/
alternativeRouteProcessor?: AlternativeRouteProcessor;

@@ -167,7 +167,7 @@ export class FerrostarCore implements LocationUpdateListener {
* views.
*
* WARNING: If you want to reuse the existing view model, ex: when getting a new route after going
* off course, use [replaceRoute] instead! Otherwise, you will miss out on updates as the old view
* off course, use {@link replaceRoute} instead! Otherwise, you will miss out on updates as the old view
* model is "orphaned"!
*
* @param route the route to navigate.

Unchanged files with check annotations Beta

extension FerrostarCore: LocationManagingDelegate {
@MainActor
public func locationManager(_: LocationProviding, didUpdateLocations locations: [UserLocation]) {

Check warning on line 378 in apple/Sources/FerrostarCore/FerrostarCore.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'locationManager(_:didUpdateLocations:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Check warning on line 378 in apple/Sources/FerrostarCore/FerrostarCore.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'locationManager(_:didUpdateLocations:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
guard let location = locations.last,
let state = state?.tripState,
let newState = navigationController?.updateUserLocation(location: location, state: state)
@MainActor
extension FerrostarCarPlayManager: CPTemplateApplicationDashboardSceneDelegate {
public func templateApplicationDashboardScene(

Check warning on line 76 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationDashboardScene(_:didConnect:to:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Check warning on line 76 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationDashboardScene(_:didConnect:to:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
_: CPTemplateApplicationDashboardScene,
didConnect _: CPDashboardController,
to _: UIWindow
) {}
public func templateApplicationDashboardScene(

Check warning on line 82 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationDashboardScene(_:didDisconnect:from:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Check warning on line 82 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationDashboardScene(_:didDisconnect:from:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
_: CPTemplateApplicationDashboardScene,
didDisconnect _: CPDashboardController,
from _: UIWindow
@MainActor
extension FerrostarCarPlayManager: CPTemplateApplicationInstrumentClusterSceneDelegate {
public func templateApplicationInstrumentClusterScene(

Check warning on line 91 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationInstrumentClusterScene(_:didConnect:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Check warning on line 91 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationInstrumentClusterScene(_:didConnect:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
_: CPTemplateApplicationInstrumentClusterScene,
didConnect _: CPInstrumentClusterController
) {}
public func templateApplicationInstrumentClusterScene(

Check warning on line 96 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationInstrumentClusterScene(_:didDisconnectInstrumentClusterController:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Check warning on line 96 in apple/Sources/FerrostarCarPlayUI/FerrostarCarPlayManager.swift

GitHub Actions / test (FerrostarCore-Package, platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1)

main actor-isolated instance method 'templateApplicationInstrumentClusterScene(_:didDisconnectInstrumentClusterController:)' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
_: CPTemplateApplicationInstrumentClusterScene,
didDisconnectInstrumentClusterController _: CPInstrumentClusterController
) {}