Спасибо @AmirGorji @parashKorat за помощь мне. Для меня эта проблема возникла, потому что я удалил android:roundIcon="@mipmap/ic_launcher_round"
из файла манифеста. Когда я ставлю это снова, react-native link
работает. Я удалил его, потому что после добавления моих значков он показывал ошибку пропуска круглого значка, для временного я удалил это.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.namaztiming">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
Я не знаю, является ли это правильным решением или нет, но в моем случае это решило проблему.
It is actually pretty easy with jQuery. Let's say your link is something like this:
<a href="javascript:flagInappropriate(<%=Model.PostId%>);">Flag as inappropriate</a>
Create a javascript to call the action in your controller to check and flag as necessary:
function flagInappropriate(postId) {
var url = "<CONTROLLER>/<ACTION>/" + postId;
$.post(url, function(data) {
if (data) {
// callback to show image/flag
} else {
// callback to show error/permission
}
});
}
In you action method in your controller will probably look like this:
[AcceptVerbs("POST")]
public bool FlagAsInappropriate(int id) {
// check permission
bool allow = CheckPermission();
// if allow then flag post
if (allow) {
// flag post
return true;
} else {
return false;
}
}