-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial module implementation #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing work! few random thoughts as I browsed through it noted
apply plugin: 'maven-publish' | ||
|
||
group = 'expo.modules.appcuesexpoconfig' | ||
version = '0.1.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious what this version is used for and whether it needs to stay in sync with the overall package version on release... will continue reading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. I think it's entirely internal (same idea as AppcuesExpoConfig.podspec
), so I don't think it matters, but it probably should match other versions, just so it's not confusing?
ff0c3db
to
cd10de8
Compare
cd10de8
to
567b929
Compare
// https://github.com/apache/cordova-node-xcode/issues/121 | ||
// addTargetDependency misses some dependency links if | ||
// PBXTargetDependency or PBXContainerItemProxy are not present. | ||
const projObjects = xcodeProject.hash.project.objects; | ||
projObjects['PBXTargetDependency'] = | ||
projObjects['PBXTargetDependency'] || {}; | ||
projObjects['PBXContainerItemProxy'] = | ||
projObjects['PBXContainerItemProxy'] || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this block after encountering issues when testing today.
Expo Overview
The Expo Modules API allows you to "write custom native code to tap into native platform APIs". There are three main APIs:
Unrelated (but can be packaged together), there are Expo config plugins that extend the app config and allow for mod(ifications)s of parts the Expo build process (eg the Xcode project, plists, gradle files).
There's a helpful Expo tutorial, Create a module with a config plugin that while not exactly what we need, show how to combine the concepts.
Implementation Overview
This PR includes a combination of the above:
plugin/*
Config plugin that copies the notification services extension to the generated project, adds the extension to the Xcode project, and updates the Podfile to make the new target depend on theAppcuesNotificationExtension
pod.ios/*
iOS AppDelegate subscriber to callAppcues.enableAutomaticPushConfig()
. TheAppcuesExpoConfig.podspec
adds the dependency on theAppcues
pod. The subscriber is registered inexpo-module.config.json
.android/*
This is where an Android lifecycle listener code would go, but we don't actually need that functionality. What we do need here is just need thebuild.gradle
to ensure the Appcues dependency is set, and then the manifest to handle the intent.Notes
android/build.gradle
plugin/src/withIosAppcuesRichPush.ts
where we add the target info to the project Podfileandroid/src/main/AndroidManifest.xml
.@appcues/react-native
. That package functions as a sibling. Obviously you'd want to use them together to do anything productive, but they are independent.