You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
Swift
38 lines
1.1 KiB
Swift
//
|
|
// LiveActivityHelper.swift
|
|
// Runner
|
|
//
|
|
// Created by Cloud Solutions on 28/01/2026.
|
|
//
|
|
|
|
import Foundation
|
|
import FLAnimatedImage
|
|
|
|
class LiveActivityHelper{
|
|
|
|
private let channelName = "clear_data"
|
|
|
|
var flutterMethodChannelPenguinIn:FlutterMethodChannel? = nil
|
|
func initialize(_ controller :FlutterViewController){
|
|
openChannel(controller: controller)
|
|
}
|
|
|
|
private func openChannel(controller :FlutterViewController){
|
|
flutterMethodChannelPenguinIn = FlutterMethodChannel(name: channelName, binaryMessenger: controller.binaryMessenger)
|
|
|
|
flutterMethodChannelPenguinIn?.setMethodCallHandler { (methodCall, result) in
|
|
print("Called function \(methodCall.method)")
|
|
|
|
|
|
if methodCall.method == "clearUserDefaultData"{
|
|
let sharedDefaults: UserDefaults = UserDefaults(suiteName: "group.alhabib.patientApp")!
|
|
sharedDefaults.removePersistentDomain(forName: "group.alhabib.patientApp")
|
|
sharedDefaults.synchronize()
|
|
result(nil)
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|