|
|
|
|
@ -16,6 +16,7 @@ import Foundation
|
|
|
|
|
import UIKit
|
|
|
|
|
import Flutter
|
|
|
|
|
import PenNavUI
|
|
|
|
|
import PenguinINRenderer
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
import Flutter
|
|
|
|
|
@ -34,6 +35,7 @@ import UIKit
|
|
|
|
|
class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitializationDelegate
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// The main view displayed within the platform view
|
|
|
|
|
|
|
|
|
|
private var _view: UIView
|
|
|
|
|
@ -155,7 +157,9 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia
|
|
|
|
|
// Set the initialization delegate to handle SDK initialization events
|
|
|
|
|
|
|
|
|
|
PenNavUIManager.shared.initializationDelegate = self
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PIRendererSettings.styleUri = "mapbox://styles/rwaid/cm3h30b36007v01qz7ik8a0sk"
|
|
|
|
|
|
|
|
|
|
// Configure the Penguin SDK with necessary parameters
|
|
|
|
|
|
|
|
|
|
PenNavUIManager.shared
|
|
|
|
|
@ -180,7 +184,9 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia
|
|
|
|
|
|
|
|
|
|
.setLanguage(args.languageCode)
|
|
|
|
|
|
|
|
|
|
.setBackButtonVisibility(true)
|
|
|
|
|
.setBackButtonVisibility(visible: true)
|
|
|
|
|
|
|
|
|
|
.setCampusID(1)
|
|
|
|
|
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
@ -269,8 +275,10 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia
|
|
|
|
|
* Called when the Penguin UI setup is successful.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func onPenNavSuccess() {
|
|
|
|
|
// func onPenNavSuccess() {
|
|
|
|
|
func onPenNavInitializationSuccess() {
|
|
|
|
|
|
|
|
|
|
print("====== onPenNavSuccess =========")
|
|
|
|
|
|
|
|
|
|
@ -340,7 +348,7 @@ class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitia
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey) { [weak self] token, error in
|
|
|
|
|
PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey, showProgress: false) { [weak self] token, error in
|
|
|
|
|
|
|
|
|
|
if let error = error {
|
|
|
|
|
|
|
|
|
|
|