Hirdetés
- Yettel topik
- Android alkalmazások - szoftver kibeszélő topik
- iPhone topik
- OnePlus 15 - van plusz energia
- Szívós, szép és kitartó az új OnePlus óra
- Motorola Edge 50 Neo - az egyensúly gyengesége
- Kezünkben a OnePlus 15 és az Oppo Find X9-ek
- Bluetooth-headsetekről általában
- Xiaomi 15T - reakció nélkül nincs egyensúly
- Apple iPhone 17 Pro Max – fennsík
Új hozzászólás Aktív témák
-
PumpkinSeed
addikt
válasz
[KgP].Robot
#4321
üzenetére
A terv most:
PluginActivity mint Main. Ha nincs URL akkor company://welcome, ha van akkor company://upload-ra intent. A probléma, amit nem értek miért nem működik:
React oldalon van a Linking package ami elkapja az ilyen beérkező kéréseket és kezeli őket. Amikor meghívom ezt:
adb shell am start -W -a android.intent.action.VIEW -d "company://$1" com.company/.MainActivityakkor működik, de amikor ezt csinálom a PluginActivity-ből, akkor nem (ez csak átküld a MainActivity-be, de az URL-t a Linking nem kapja meg, szóval félig működik):
Intent intent = new Intent();
String uriString = "company://welcome";
intent.setData(Uri.parse(uriString));
startActivity(intent);Az ide tartozó React Native rész:
componentWillMount() {
Linking
.getInitialURL()
.then(event => this.handleOpenURL(event))
.catch(console.error);
Linking.addEventListener('url', this.handleOpenURL);
this.props.loadCredentials();
}
handleOpenURL(event) {
console.log('Event:');
console.log(event);
if (event === null || event.url === undefined || Helpers.isObjectEmpty(event)) {
this.props.setWelcomeRedirect(true);
return 0;
}
var res = event.url.split("#");
switch (res[0]) {
case `${Config.APP_SCHEMA}upload`:
Actions.Upload();
break;
default:
Actions.Home();
}
}Az utolsó módosított Manifest.xml:
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name="com.company.MainActivity"
android:launchMode="singleTask"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="company"
android:host="*" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.company.PluginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/vnd.sony.scan3d" />
</intent-filter>
</activity>
</application>
Új hozzászólás Aktív témák
- Spiegen Rugged Armor Pro tok PS Portal-hoz
- ÚJÉVI AKCIÓK / MICROSOFT WINDOWS 10,11 / OFFICE 16,19,21,24 / VÍRUS,VPN VÉDELEM / SZÁMLA / 0-24
- ÁRGARANCIA!Épített KomPhone i5 14400F 16/32/64GB RAM RX 9060 XT 16GB GAMER PC termékbeszámítással
- Apple iPhone 13 Pro 256GB, Kártyafüggetlen, 1 Év Garanciával
- CoolerMaster MM710 53gr pehelykönnyű gamer egér eladó
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


