forked from flutter-mapbox-gl/maps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional documentation (flutter-mapbox-gl#986)
* Added docs for running example code on iOS * Updated running example code docs Resized screenshot Added index to Readme
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Running the example code | ||
|
||
- You'll find the example code in the `example` folder of this repository | ||
|
||
## Secret Mapbox access token | ||
|
||
A secret access token with the `Downloads: Read` scope is required for the underlying Mapbox SDKs to be downloaded. | ||
Information on setting it up is available in the Mapbox documentation: | ||
[Android](https://docs.mapbox.com/android/maps/guides/install/), | ||
[iOS](https://docs.mapbox.com/ios/maps/guides/install/). | ||
|
||
If the properly configured token is not present, | ||
the build process fails with one the following errors *(for Android/iOS respectively)*: | ||
|
||
``` | ||
* What went wrong: | ||
A problem occurred evaluating project ':mapbox_gl'. | ||
> SDK Registry token is null. See README.md for more information. | ||
``` | ||
|
||
``` | ||
[!] Error installing Mapbox-iOS-SDK | ||
curl: (22) The requested URL returned error: 401 Unauthorized | ||
``` | ||
|
||
## iOS | ||
- Clone this repo | ||
- Open `example/ios/Runner.xcworkspace` in XCode | ||
- On the left, select Runner and change the Bundle identifier on the `general` tab to something of your own. | ||
|
||
![XCode bundle identier](img/xcode-bundle-identifier.png) | ||
|
||
- On the `signing & capabilities` tab change the team to your own. | ||
- Close Xcode | ||
- run `flutter build ios --dart-define ACCESS_TOKEN=sk.xxxxxxxxxxxxxxxxxxxxx` to make sure the project builds from the command line. The `ACCESS_TOKEN` is the Mapbox token you've obtained in the `Secret Mapbox access token` step described above. | ||
- The build command output should be something like: | ||
|
||
```terminal | ||
Warning: You are using these overridden dependencies: | ||
! mapbox_gl_platform_interface 0.15.0 from path ../mapbox_gl_platform_interface | ||
! mapbox_gl_web 0.15.0 from path ../mapbox_gl_web | ||
Running "flutter pub get" in example... 1,918ms | ||
Building com.xxx.mapboxtest for device (ios-release)... | ||
Updating project for Xcode compatibility. | ||
Upgrading project.pbxproj | ||
Upgrading Runner.xcscheme | ||
Signing iOS app for device deployment using developer identity: "Apple Development: xxx@xxxxx.xx (XXXXXXX)" | ||
Running pod install... 2,950ms | ||
Running Xcode build... | ||
└─Compiling, linking and signing... 15.1s | ||
Xcode build done. 98.2s | ||
Built /Development/flutter/maps/example/build/ios/iphoneos/Runner.app. | ||
``` | ||
|
||
- Open `example/ios/Runner.xcworkspace` again in XCode | ||
- Run the project connected iPhone or iOS Emulator | ||
|
||
![XCode bundle identief](img/example-iphone.jpeg) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.