Revmob Unity : Banner ads not clickable - unity3d

I am developing a game which required to show Revmob Banner ads.
I can successfully show banner ads, but can't not click on it. It's media id is into testing mode.
My code for it is below.
private RevMob rev mob;
void Awake() {
revmob = RevMob.Start(REVMOB_APP_IDS, "RevMob");
}
void Start() {
revmob.CreateBanner(RevMob.Position.BOTTOM);
revmob.ShowBanner(RevMob.Position.BOTTOM);
}
Please help me.

Try adding the following line in the AndroidManifest.xml file within the activity tags for UnityPlayerNativeActivity
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
Example
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false" android:largeHeap="true">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="#string/app_name" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>

Related

Need Help on a Facebook app code in order to show Live Videos

I need some assistance on my final capstone design project for my university. My question is, How can I develop an android studio code (Kotlin) for Facebook in order to show Live videos from a "Client" website?
I already have a working code that shows the client's website, just need to be able to show his Live videos. This work is to finish my bachelor's degree in ELECTRICAL engineering, so no previous experience in programming apart from the C++ classes that I took 3 years ago.
This is the code i have now,
class FacebookActivity : AppCompatActivity() {
private lateinit var callbackManager: CallbackManager
/**
* This creates the page for Facebook login
*/
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_facebook)
// Initialize the Facebook Login callback manager
callbackManager = CallbackManager.Factory.create()
// Register a callback for the Facebook Login button
btnLogin.registerCallback(callbackManager, object : FacebookCallback<LoginResult> {
// If the Facebook Login is successful
override fun onSuccess(loginResult: LoginResult) {
Log.d("FacebookActivity", "Facebook token: " + loginResult.accessToken.token)
startFacebookPage()
}
// If the Facebook Login is cancelled
override fun onCancel() {
Log.d("FacebookActivity", "Facebook Login cancelled.")
}
// If there is an error during the Facebook Login
override fun onError(error: FacebookException) {
Log.d("FacebookActivity", "Facebook Login error: " + error.message)
}
})
// Check if the user is already logged in to Facebook
if (AccessToken.isCurrentAccessTokenActive()) {
startFacebookPage()
} else {
// Log in the user with read permissions if they are not already logged in
LoginManager.getInstance().logInWithReadPermissions(this, listOf("public_profile"))
}
}
// Start the Facebook page
private fun startFacebookPage() {
val facebookIntent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse("https://www.facebook.com/radiodiosmedijonotecalles")
}
startActivity(facebookIntent)
}
/**
* This allows to go "back"
*/
override fun onSupportNavigateUp(): Boolean {
onBackPressedDispatcher.onBackPressed()
return true
}
}
And the Manifest;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher2"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher2_round"
android:supportsRtl="true"
android:theme="#style/Theme.RadioDiosMeDijoNoTeCalles"
tools:targetApi="33">
<activity
android:name=".ClientActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="false" />
<activity
android:name=".AboutThisAppActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="false" />
<activity
android:name=".FacebookActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="true" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="#string/facebook_client_token" />
<activity
android:name=".ZenoRadioActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".YouTubeActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="false" />
<activity
android:name=".LinksActivity"
android:exported="false" />
<activity
android:name=".TwitchActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="false" />
<activity
android:name=".DonationsActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|touchscreen|smallestScreenSize"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any and all Help will be greatly appreciated!

Flutter android alarm manager plus works in emulator periodically but not working in real device?

I am using flutter android alarm manager package to get local notifications periodically. It's working perfectly in the emulator but when I am generating an apk file and installing the app in a real android device through that apk file it's not showing any notification.
So, could anyone please help me sharing your precious experience. Thanks in advance!
Here you go with my code -
Future<void> notify() async {
try {
await Quote.saveNewQuote();
} catch (e) {
print(e.toString());
}
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 1,
channelKey: 'basic_notification',
title: 'Notification',
body: 'Android alarm manager periodical notification',
));
// await Quote.notifyLastQuote();
}
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AndroidAlarmManager.initialize();
await AwesomeNotifications().initialize('resource://drawable/fitjerk_logo',
[
NotificationChannel(
channelKey: 'basic_notification',
channelName: 'FitJerk Motivation',
channelDescription: "FitJerk Today Notification ",
defaultColor: primaryDeepColor,
importance: NotificationImportance.High,
ledColor: Colors.white,
playSound: true,
enableLights: true,
enableVibration: true
)
]);
await AndroidAlarmManager.periodic(const Duration(hours: 24), 1, notify,
///TODO: here will set startAt time///
startAt: DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 30),
exact: true, wakeup: true, allowWhileIdle: true, rescheduleOnReboot: true);
And here is my AndroidMenifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.fit_jerk">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- For apps with targetSDK=31 (Android 12) -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
<application
android:label="FitJerk"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher"
tools:ignore="ExtraText">
<!-- this portion is for android alarm plus-->
<!-- android:name = "io.flutter.app.FlutterApplication"-->
<service
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"
tools:ignore="MissingClass" />
<receiver
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmBroadcastReceiver"
android:exported="false"
tools:ignore="MissingClass" />
<receiver
android:name="dev.fluttercommunity.plus.androidalarmmanager.RebootBroadcastReceiver"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="#string/facebook_client_token"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
tools:ignore="MissingClass" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true"
tools:ignore="MissingClass">
<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="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-8656344449994415~3632328521"/>
</application>
</manifest>

Im trying to get link after deep linking rotate

im opening app from link. but i cant listen my link after opened app. i need to get a token from link.
AndroidManifest.xml:
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<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="https"
android:host="myappname.page.link" />
</intent-filter>
and my listener uni_links like that:
getLinksStream().listen((link) async {
print("urigirdi");
try {
var _latestUri;
if (link != null) _latestUri = Uri.parse(link);
setState(() {
sourceLink = link!.split("/")[3];
print("link");
linkToken = sourceLink.split("?")[2];
linkPath = sourceLink.split("?")[0];
print(linkPath);
print(linkToken);
});
} on FormatException {
print("--- A link got here but was invalid");
}
});
i need some help. can anybody help me ? thanks for everything...

share list of Images from gallery and any type of files from outside our application:

I'm trying to share a list of images from the gallery into my app to use it recycler view
or any thing else
<activity
android:icon="#mipmap/ic_launcher"
android:name=".MainActivity"
>
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.SEND"/>
<data android:mimeType="*/*"/>
</intent-filter>
</activity>
that works:-
1-specify these lines on the manifest
<activity
android:icon="#mipmap/ic_launcher"
android:name=".MainActivity"
>
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<data android:mimeType="*/*"/>
<data android:mimeType="image/jpeg" />
<data android:mimeType="image/png" />
<data android:mimeType="image/jpg" />
</intent-filter>
</activity>
2-Second get the action that opened your intent and check if its the one we registered for the activity and then the data is received as ArrayList of Uri
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = getIntent();
if (Intent.ACTION_SEND_MULTIPLE.equals(intent.getAction())) {
Bundle extras = intent.getExtras();
if (extras.containsKey(Intent.EXTRA_STREAM)) {
ArrayList<Uri> urisArrayList = extras.getParcelableArrayList(Intent.EXTRA_STREAM);
urisArrayList.forEach(i-> Log.d(TAG, "onCreate: "+i.toString()));
}
}}

Android Facebook Login button XML error

I want to create a test project works 'facebook login'.
I made with reference to the developers site and blog equal, But I met with an error message on xml.
[error massage]
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.facebooktest.zoit.facebooktest/com.facebooktest.zoit.facebooktest.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class com.facebook.login.widget.LoginButton
[xml]
<com.facebook.login.widget.LoginButton
android:id="#+id/facebook_login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="30dp"
android:layout_marginTop="30dp" />
[Manifest]
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebooktest.zoit.facebooktest">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
</manifest>
[MainActivity]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
facebookLoginButton.registerCallback(callbackManager,
new FacebookCallback<LoginResult>() {...
...
public void onActivityResult(...
void geHashKey(){...
void geHashKey(){ ...
public void onResume(){ ...
public void onPause(){...
Do you know what's wrong? please help.
I know!
FacebookSdk.sdkInitialize(getApplicationContext());
AppEventsLogger.activateApp(this);
setContentView(R.layout.activity_main);
"setContentView(R.layout.activity_main);"
I succeeded to move the this code below to Facebook code.