Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • interkit-experiments interkit-experiments
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 115
    • Issues 115
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • interkit
  • interkit-experimentsinterkit-experiments
  • Issues
  • #494

Closed
Open
Created Dec 14, 2023 by Sebastian Quack@sebquackMaintainer24 of 25 tasks completed24/25 tasks

Update to Capacitor 5, fix push messages on Android13+

do a hackathon together with @jakob and @sebquack to work on this


  • try updating to Capacitor5, use updated Pushnotifications plugin
    • update interkit package package.json 2.4.7→5.6.0
    • update android studio >=2022
    • update project package.json 2.4.7→5.6.0, add plugins
    • upgrade existing project to new capacitor
    • re-init project: rm -rf android; npx cap add android; npx cap sync android
    • fix CLEARTEXT error
    • re-add android/app/google-services.json (from starter)
    • update PushNotifications.requestPermissions()
    • disable InterkitLiveReload
  • test on real Android13+ device
  • test targetSdk 33
    looks like Capacitor5 comes with current variables.gradle:
    minSdkVersion = 22, compileSdkVersion = 33, targetSdkVersion = 33
  • fix isPushNotificationsAvailable
  • check new(?) plugin API: https://capacitorjs.com/docs/apis/push-notifications, like icon, style
    added some handwavey docs
  • in Capacitor5, SplashScreen and Network plugin claim to be "not implemented" on either ios and android.
    SplashScreen probably doesn't matter, but we do use Network ⇒ fix?

    I had referenced in code, which lead to Exceptions being thrown and a IMO misleading "not implemented".
    Fixed by npm i --save @capacitor/network. I confirmed that network plugin still works;
    not sure if splash-screen has any tangible effect, though.
  • fix InterkitLiveReload
    ⇒ properly, cleanly disable live reload

    disable the live update functionality for now. Let's keep the native app support simple and up to date and focus on pwa support going forward? comment

    • remove capacitor plugins file + zip ?
  • check if http plugin replaced ok
    plus seems like it was explicitly only used in interkit-live-reload.js, indeed

    the next iteration of this plugin will be an official plugin bundled with Capacitor 4.x. see

  • check barcode-scanner plugin
    don't need it any more, only used by components/v03/QRScannerCap.svelte, which is good because

    This package is deprecated in favor of @capacitor-mlkit/barcode-scanning README
    [although] v4.x supports Capacitor v5.x

  • check Geolocation plugin
  • update iOS
    • including heavy firebase setup
  • some .get fails when "moving legacy localStorage to persistent Capacitor Storage"?
    Storage plugin does not exist any more in v5!
    ⇒ probably move to Preferences API
  • update starter
    • consider not including the capacitor platform directories starter/android and starter/ios.
      instead, add to docs how to create them (npx cap add android) -- this might be even failsafer than editing bundleIds after the fact..
      update android + ios dirs; add docs
    • fix splash icon
    • fix app icon
    • fix whatever else we customized
  • update docs
    • push notification guide
    • general native app guide https://docs.interkit.app/guides/howto/native

starter prepopulated vs re-initialized dir analysis/diff

cap v2, android

  • http plugin setup -- will be moot
  • AndroidManifest: <application android:usesCleartextTraffic="true" -- missing in reinited
  • prepop android/app/google-services.json so FCM compilation doesnt choke -- missing reinited, but could be handled by push setup docs?

cap v2, ios

  • ios/App/App/Info.plist: english strings re geolocation:
    >Turning on location services allows us to mark your location on the map and customize the experience according to your location.
    vs
    Always allow Geolocation? (re-inited)
    does the user even see this?
  • ios/App/App.xcodeproj/project.pbxproj -- reinited has more up-to-date bundleId!

cap v5, android

AndroidManifest: (apparently npx cap sync doesn't set this automatically any more in v5??) per docs

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

⇒ we'll just keep these; added docs like "remove if unnecessary"


create new starter

  1. rm -rf android ios
  2. update package.json & add plugin deps
    • main package -> 5.6.0
    • remove barcode-scanner, cordova-{file,zip}
    • npm i --save @capacitor/{geolocation,network,preferences,push-notifications,splash-screen}
    • or is push "optional"? does it need detection to work/compile without?
  3. npm run build; npx cap add {android,ios}; npx cap sync
    on ios: export LANG=en_US.UTF-8
  4. commit updated files with manual corrections
    • cleartext
    • google-services.json -- or is it optional and can compile without?
    • android location permissions -- i think it could be argued that this is in a way optional, too, when you don't use a Map, you dont need extra permissions...
  5. create project from starter template-maxi, which uses starter
    • regenerate template-maxi: in admin, delete it, then admin tools › Build Project Templates
    • replace bundleid
      • android: capacitor.config.json android/app/build.gradle ios/App/App/capacitor.config.json android/app/src/main/res/values/strings.xml android/app/src/main/java/interkit/app/starter/MainActivity.java
        find android/ -type f -exec sed -i -e s/interkit.app.starter/your.bundle.id/ \{\} \;
    • add and test plugin-using components
      • map
      • chat

do this for

  • android
  • ios

fixes:

  • regenerate starter/server/package-lock.json wtf

  • spin off 1-3 as documentation "in case you need to restart ios/android"
  • maybe update docs like this: remove unnecessary permissions from AndroidManifest
  • what about capacitor-bundle-viewer?
  • add note to InterkitLiveReload stuff what plugins to re-install
Edited Jan 18, 2024 by Jakob Wierzba
Assignee
Assign to
Time tracking