Sending message to android emulator using firebase cloud message - firebase

I am testing to send a notification to my android emulator, it is working as it prints the details as it able to receive and means that is being triggered but the problem here is it doesn't pop up and even show on the notification panel of the android.
Firebase cloud messaging
Terminal
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rnfirebaseapp101">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<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|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Change the value to true to enable pop-up for in foreground on receiving remote notifications (for prevent duplicating while showing local notifications set this to false) -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="false"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="#color/white"/> <!-- or #android:color/{name} to use a standard color -->
<!-- <meta-data android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="#string/default_notification_channel_id" /> -->
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
EDIT:
Here is the guide I am following: https://blog.jscrambler.com/implementing-react-native-push-notifications-in-android-apps

Related

Android TV launcher app not working as Home screen app

I am trying to create a default launcher app for Android TV box. Here is the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.raza.mlauncher">
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
</intent>
</queries>
<application
android:allowBackup="true"
android:banner="#mipmap/ic_launcher"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme.NoActionBar">
<activity
android:launchMode="singleTask"
android:name=".MainActivity"
android:exported="true"
android:priority="2">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER_APP" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
</application>
</manifest>
But when I press home button on Android TV simulator, it does not ask to select the default home app. Even in settings of the device, there is no option available to choose a default launcher from installed ones. Is there any limitation on creating launcher apps for Android TV boxes?

How do we make Launcher/Home android app for AndroidTV device?

I did in Manifest.xml file
<!-- Start For Android Tv Box-->
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<uses-feature
android:name="android.software.live_tv"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<!-- End For Android Tv Box-->
MainActivity is my first activity which is the firest screen of my app.
<activity
android:name=".MainActivity"
android:hardwareAccelerated="false"
android:screenOrientation="landscape"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:launchMode="singleInstance"
android:autoRemoveFromRecents="true"
android:resumeWhilePausing="true"
android:resizeableActivity="true"
tools:targetApi="n">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="supports_leanback" android:value="true" />
</activity>
When user tapped on Home button of AndroidTv remote Home/Launcher popup should come up and choose a launcher app for AndroidTv device, then whenever user power on device my app should be come as a launcher app.
Making an app as the launcher in Android TV is the same as other android devices. You only need to add a category named android.intent.category.HOME in your activiy's intent-filter. Use the following lines to change your AndroidManifest.xml:
<activity
android:name=".MainActivity"
...>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
...
</intent-filter>
</activity>

flutter unresolved class 'FacebookActivity'

I don't know why it says unresolved class, although the documentation doesn't mention anything related to declaring it or anything.
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="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="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
in both the customTabActivity and FacebookActivity it says unresolved class
Class referenced in the manifest, com.facebook.CustomTabActivity, was
not found in the project or the libraries
and
Class referenced in the manifest, com.facebook.FacebookActivity, was
not found in the project or the libraries

Visual Studio localhost IIS Server Not Found

I'm trying to run an ASP.NET webforms website that I downloaded from an FTP server, but I'm running into problems when I try to build and run the project.
When I build and run the website, it opens my browser window, but adds "www." before the localhost address and I get a server not found error. I'm able to successfully build and run other websites, so I think I must have something wrong in the web.config or website properties. Here's a screenshot of my browser window:
Visual Studio Version: 15.7.2
IS Express: 10.0.1743
I tried changing the IIS port being used in the application.config file to see if that helped, but it gets replaced by a new site tag after I edit the original one. For example if my original port is 51060 and I change it to 51065 like this:
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="mywebsite" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\me\Documents\mywebsite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:51065:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
The application.config file changes to:
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="mywebsite" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\me\Documents\mywebsite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:51065:localhost" />
</bindings>
</site>
<site name="mywebsite(1)" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\me\Documents\mywebsite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:51060:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
Thanks for any help.
Right click on your web forms application project and then properties, navigate to the Web section, then look at the Servers section, and look at the Project Url that is being used, you can also mark the option Override application root URL if needed.
I hope it helps.

Why doesn't my serviceAuthenticationManagerType get called for basic authentication?

I am working with WCF OData Services and trying to use basic authentication. When I browse to my OData Services in a web browser I get the username/password prompt. But when I enter a user name and password my custom serviceAuthenticationManagerType does not get called and the login fails. Do I have something configured wrong?
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="basicHttp">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="dataServiceBehavior">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="WcfResearch.AuthorizationManagers.WcfResearchAuthorizationPolicy, WcfResearch.AuthorizationManagers" />
</authorizationPolicies>
</serviceAuthorization>
<serviceAuthenticationManager authenticationSchemes="Basic" serviceAuthenticationManagerType="WcfResearch.AuthorizationManagers.WcfResearchAuthenticationManager, WcfResearch.AuthorizationManagers"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="WcfResearch.WcfDataService1" behaviorConfiguration="dataServiceBehavior">
<endpoint binding="webHttpBinding" bindingConfiguration="basicHttp" contract="System.Data.Services.IRequestHandler" />
</service>
</services>

Resources