Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ionic Capacitor example app #992

Merged
merged 11 commits into from
May 21, 2024
Merged

Add Ionic Capacitor example app #992

merged 11 commits into from
May 21, 2024

Conversation

jennantilla
Copy link
Contributor

@jennantilla jennantilla commented May 9, 2024

Description

One Line Summary

Add Ionic Capacitor example app

Details

Motivation

Unlike many of our other repos, Cordova does not have an integrated example app. This means that currently, any testing for the SDK must be done by linking/unlinking the changing repo to a separate standalone app. The demo apps provided in the README are limited in terms of method functionality and are out-of-date (Player Model). Further, since test apps are not directly linked to the SDK, a fair bit of set up is required on the tester side to get started.

Adding an integrated example app with User Model methods and an automatic linked dependency to the SDK will allow for a seamless test experience for further Cordova SDK development.

The Ionic Capacitor React framework (vs. Cordova) was chosen due to its more widespread use from our customers as well as its enhanced native functionality and robust product support. Additionally, since this example app uses React, updating it will be very similar to the existing React Native app, which will aid in app maintenance and reduce context switching while testing between the two SDKs.

Scope

A new directory, /examples has been added to the Cordova SDK.

From this directory, the example app can be opened by running:

ionic capacitor run android

ionic capacitor run ios

Testing

Manual testing

Functional testing of the added method buttons was completed on both an iOS 17.2 simulator as well as an Android 14 Emulator.

iOS

Android

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

jennantilla added 10 commits May 2, 2024 20:07
- Ionic Capacitor
- React Framework
Includes basic initialization with logging and push permission prompting.

The OneSignal plugin is added as a linked dependency in this repo, facilitating more efficient testing of SDK changes.

IMPORTANT: Updating vite.config is necessary for the app to build.
source: https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies
- create iOS blank app
- install OneSignal plugin
- update bundle ID
- add Push & Background Modes capabilities
- React functionality closely resembles React Native example app
- Update rendering for Ionic
- include demo project information
- update supported Android/iOS versions
Copy link
Contributor

@nan-li nan-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@jennantilla jennantilla merged commit 94aa069 into main May 21, 2024
3 checks passed
@jennantilla jennantilla deleted the example_app branch May 21, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants