Comments (5)
@vasklund I believe you can have a different AirshipConfig.plist files included in each target. The SDK will pick up the one for the target.
How are you accomplishing this on Android?
from react-native-airship.
Interesting, I will give this a try on Monday! My iOS development skills are still very lacking :)
Is there any analogous way to do this for Android? Right now I just use a custom AutoPilot
on Android. Something like
<meta-data
android:name="com.urbanairship.autopilot"
android:value="se.svd.start.MyAutopilot"
tools:replace="android:value"
/>
in AndroidManifest.xml, then I load my config file in
public AirshipConfigOptions createAirshipConfigOptions(@NonNull Context context)
like this:
Properties properties = new Properties();
try {
InputStream inputStream = context.getAssets().open("airshipconfig_" + BuildConfig.PRODUCT + ".properties");
properties.load(inputStream);
} catch (IOException e) {
throw new RuntimeException(e);
}
where PRODUCT
is a config variable injected via react-native-config
.
from react-native-airship.
(Right now we build the config "by hand" with
return new AirshipConfigOptions.Builder()
.setDevelopmentAppKey(...)
.setDevelopmentAppSecret(...)
etc., but I realized (but haven't confirmed) today that we can probably just do
return new AirshipConfigOptions.Builder()
.applyProperties(context, "airshipconfig_" + BuildConfig.PRODUCT + ".properties")
.setCustomThing("myCustomRuntimeValue");
instead.)
from react-native-airship.
Yeah you could do that for Android instead of loading the properties file by hand. Another option is to take advantage of the "flavors" feature of Android and have a AirshipConfig.properites
file per flavor.
from react-native-airship.
I've got it working now, it was indeed possible to do it simply using targets for iOS and product flavors for Android. Less code and easier to understand IMHO.
Thanks for your help!
from react-native-airship.
Related Issues (20)
- After April 2023 Apple deployment target & XCode 14.3 update fails to compile HOT 9
- Concurrency is only available in iOS 13.0.0 or newer HOT 2
- Push successfully received on Android, but not displaying as a "heads-up" banner HOT 4
- MessageCenterUpdatedEvent sends different values for ios and android HOT 2
- The number of unread notifications on the app icon is not reduced on iOS HOT 15
- Live Activity support HOT 6
- Could not resolve com.urbanairship.android:urbanairship-hms:7.0.2. HOT 3
- ld: library not found for -lAirshipExtensions HOT 1
- Airship Message center is not working for android HOT 6
- [Android]: 'channelEditTags' overrides nothing HOT 2
- [Android] AirshipModule.kt failing due to type errors HOT 4
- Crashes on iOS with KERN_INVALID_ADDRESS, KERN_PROTECTION_FAILURE. v16.0.0 HOT 1
- How to create App Screens with Expo-Router? HOT 4
- `featureFlagManager.flag` throwing error on Android. HOT 3
- A problem occurred evaluating project ':react-native-airship' HOT 6
- Expo SDK 50 - Foreground notifications cause app to reload HOT 7
- Incorrect type definition on `listIconUrl` HOT 2
- Starting iOS Live Activities HOT 4
- AirshipFrameworkProxy.AirshipProxyError on ios with expo HOT 2
- AirshipCore.UARemoteDataMapping errors after upgrading to v18.0.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-airship.