PenguinIn android updates

master
haroon amjad 1 week ago
parent d9e6c60d0d
commit d83c1bb2c9

@ -52,7 +52,7 @@
<uses-permission <uses-permission
android:name="android.permission.ACCESS_BACKGROUND_LOCATION" android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
tools:node="remove" /> <!-- <uses-permission android:name="android.permission.INTERNET" /> --> tools:node="remove" /> <!-- <uses-permission android:name="android.permission.INTERNET" /> -->
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> --> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />

@ -30,6 +30,8 @@ import com.peng.pennavmap.interfaces.PIEventsDelegate
import com.peng.pennavmap.interfaces.PILocationDelegate import com.peng.pennavmap.interfaces.PILocationDelegate
import com.peng.pennavmap.interfaces.RefIdDelegate import com.peng.pennavmap.interfaces.RefIdDelegate
import com.peng.pennavmap.models.PIReportIssue import com.peng.pennavmap.models.PIReportIssue
import com.peng.pennavmap.models.LocationMessage
import penguin.com.pennav.renderer.PIRendererSettings
/** /**
* Custom PlatformView for displaying Penguin UI components within a Flutter app. * Custom PlatformView for displaying Penguin UI components within a Flutter app.
* Implements `PlatformView` for rendering the view, `MethodChannel.MethodCallHandler` for handling method calls, * Implements `PlatformView` for rendering the view, `MethodChannel.MethodCallHandler` for handling method calls,
@ -43,7 +45,8 @@ internal class PenguinView(
messenger: BinaryMessenger, messenger: BinaryMessenger,
activity: MainActivity, activity: MainActivity,
val channel: MethodChannel val channel: MethodChannel
) : PlatformView, MethodChannel.MethodCallHandler, PenNavUIDelegate { ) : PlatformView, MethodChannel.MethodCallHandler, PenNavUIDelegate, PIEventsDelegate,
PILocationDelegate {
// The layout for displaying the Penguin UI // The layout for displaying the Penguin UI
private val mapLayout: RelativeLayout = RelativeLayout(context) private val mapLayout: RelativeLayout = RelativeLayout(context)
private val _context: Context = context private val _context: Context = context
@ -183,6 +186,7 @@ internal class PenguinView(
"TAG", "TAG",
"initPenguin: ${Languages.getLanguageEnum(creationParams["languageCode"] as String)}" "initPenguin: ${Languages.getLanguageEnum(creationParams["languageCode"] as String)}"
) )
PIRendererSettings.styleUri = "mapbox://styles/rwaid/cm3h30b36007v01qz7ik8a0sk"
PlugAndPlaySDK.configuration = PlugAndPlayConfiguration.Builder() PlugAndPlaySDK.configuration = PlugAndPlayConfiguration.Builder()
.setBaseUrl( .setBaseUrl(
creationParams["dataURL"] as String, creationParams["dataURL"] as String,
@ -203,8 +207,12 @@ internal class PenguinView(
.setEnableBackButton(true) .setEnableBackButton(true)
// .setDeepLinkData("deeplink") // .setDeepLinkData("deeplink")
.setCustomizeColor("#2CA0AF") .setCustomizeColor("#2CA0AF")
.setDeepLinkSchema("") // .setDeepLinkSchema("")
.setIsEnableReportIssue(true) .setDeepLinkData("")
.setIsEnableReportIssue(false)
.setEnableSharedLocationCallBack(false)
.setShowUILoader(true)
.setCampusId(creationParams["projectID"] as Int)
.build() .build()
// Set location delegate to handle location updates // Set location delegate to handle location updates
@ -229,6 +237,8 @@ internal class PenguinView(
// }) // })
// Start the Penguin SDK // Start the Penguin SDK
PlugAndPlaySDK.setPiEventsDelegate(this)
PlugAndPlaySDK.setPiLocationDelegate(this)
PlugAndPlaySDK.start(mContext, this) PlugAndPlaySDK.start(mContext, this)
} }
@ -317,4 +327,20 @@ internal class PenguinView(
Log.e("PenguinView", "Receiver not registered: $e") Log.e("PenguinView", "Receiver not registered: $e")
} }
} }
override fun onReportIssue(issue: PIReportIssue?) {
TODO("Not yet implemented")
}
override fun onSharedLocation(link: String?) {
TODO("Not yet implemented")
}
override fun onLocationOffCampus(location: ArrayList<Double>?) {
TODO("Not yet implemented")
}
override fun onLocationMessage(locationMessage: LocationMessage?) {
TODO("Not yet implemented")
}
} }

@ -19,5 +19,5 @@
<string name="GEOFENCE_REQUEST_TOO_FREQUENT"> <string name="GEOFENCE_REQUEST_TOO_FREQUENT">
Geofence requests happened too frequently. Geofence requests happened too frequently.
</string> </string>
<string name="mapbox_access_token" translatable="false">sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg</string> <string name="mapbox_access_token" translatable="false">pk.eyJ1IjoicndhaWQiLCJhIjoiY2x5cGo4aHNjMGNsbTJyc2djempobGQxaSJ9.RCaC6WrUt4A4YnZNfxnONQ</string>
</resources> </resources>

@ -41,9 +41,9 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"

@ -26,7 +26,7 @@ var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil
func initializePlatformChannels(){ func initializePlatformChannels(){
if let mainViewController = window.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground if let mainViewController = window!.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground
flutterViewController = mainViewController flutterViewController = mainViewController
HMGPlatformBridge.initialize(flutterViewController: flutterViewController) HMGPlatformBridge.initialize(flutterViewController: flutterViewController)
OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok")) OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok"))

Loading…
Cancel
Save