![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
in-app-updates-capacitor
Advanced tools
Enables In App Updates on Android using the official Android APIs.
This plugin integrates the official Android APIs to perform in app updates that were released in 2019: https://developer.android.com/guide/app-bundle/in-app-updates
npm i in-app-updates-capacitor
npx cap sync
Register the plugin in your main activity:
import com.dwlrathod.inappupdates.InAppUpdatesPlugin;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(InAppUpdatesPlugin.class);
}});
}
}
iOS does not offer such functionality. If you call the methods above on an iOS device you'll run into a not-implemented exception.
If you call the methods above on a Browser you'll run into a not-implemented exception.
Requests the update availability for the current app. This method need to call before calling startFlexibleUpdate
or performImmediateUpdate
.
import { Plugins } from "@capacitor/core";
const { InAppUpdatesPlugin } = Plugins;
import { AppUpdateInfo } from "in-app-updates";
InAppUpdatesPlugin.checkForUpdate().then(
(updateInfo: AppUpdateInfo) => {
console.log(updateInfo);
},
(error: any) => {
console.error("error: " + error);
}
);
AppUpdateInfo
interface:
updateAvailable: boolean;
: Returns whether an update is available for the app.immediateUpdateAllowed: boolean;
: Returns whether the immediate is allowed.flexibleUpdateAllowed: boolean;
: Returns whether the flexible is allowed.availableUpdateVersionCode: number;
: If an update is available or in progress, this method returns the version code of the update.availableUpdatePriority: number;
: Returns the in -app update priority for this update, as defined by the developer in the Google Play Developer API.Shows flexible update dialog. User will choose weather update or not.
InAppUpdatesPlugin.startFlexibleUpdate().then(
() => {
// Update downloaded complete and now you can start installing it.
// completeFlexibleUpdate()
},
(error: any) => {
// User select No Thanks from update dialog.
// error : user_canceled, no_update_found
}
);
flexibleUpdateStateChange
listener will listen the status of downloading/downloaded update. You need to add the listener before calling startFlexibleUpdate
.
import { FlexibleUpdateState } from "in-app-updates";
InAppUpdatesPlugin.addListener("flexibleUpdateStateChange", (info: FlexibleUpdateState) => {
console.log("flexibleUpdateStateChange was fired ", info.status);
if (info.status) {
this.appendEcho("status: " + info.status);
this.appendEcho("bytesDownloaded: " + info.bytesDownloaded);
this.appendEcho("totalBytesToDownload: " + info.totalBytesToDownload);
}
});
For a flexible update flow, triggers the completion of the update. This method will only work with Flexible update and after update downloaded successfully.
InAppUpdatesPlugin.completeFlexibleUpdate().then(
() => {
// New update installation started succefully.
},
(error: any) => {
// error
}
);
Performs an immediate update.
InAppUpdatesPlugin.performImmediateUpdate().then(
() => {
// Immediate update started
},
(error: any) => {
// error : user_canceled, no_update_found
}
);
FAQs
Enables In App Updates on Android using the official APIs.
The npm package in-app-updates-capacitor receives a total of 1 weekly downloads. As such, in-app-updates-capacitor popularity was classified as not popular.
We found that in-app-updates-capacitor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.