Archived
Menyelesaikan plugin, siap ucob
This commit is contained in:
1 parent
6f5478e9ab
commit
caf005b82d
14 files changed
+312
-15
No files matched your search
+10
-3
@@ -15,7 +15,7 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
api: PluginApi<R, C>,
|
||||
) -> crate::Result<Auth<R>> {
|
||||
#[cfg(target_os = "android")]
|
||||
let handle = api.register_android_plugin("", "ExamplePlugin")?;
|
||||
let handle = api.register_android_plugin("com.plugin.auth", "AuthPlugin")?;
|
||||
#[cfg(target_os = "ios")]
|
||||
let handle = api.register_ios_plugin(init_plugin_auth)?;
|
||||
Ok(Auth(handle))
|
||||
@@ -25,7 +25,14 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
pub struct Auth<R: Runtime>(PluginHandle<R>);
|
||||
|
||||
impl<R: Runtime> Auth<R> {
|
||||
pub fn autentikasi(&self) -> crate::Result<Vec<()>> {
|
||||
return self.0.run_mobile_plugin("autentikasi").map_err(Into::into);
|
||||
pub fn masuk(&self, payload: SAuthMuatanMasuk) -> crate::Result<()> {
|
||||
return self
|
||||
.0
|
||||
.run_mobile_plugin("masuk", payload)
|
||||
.map_err(Into::into);
|
||||
}
|
||||
|
||||
pub fn keluar(&self) -> crate::Result<Vec<()>> {
|
||||
return self.0.run_mobile_plugin("keluar", ()).map_err(Into::into);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user