Skip to content

Notification support #412

@Saleca

Description

@Saleca

I was trying to configure notifications on an app but the way i know relies on platform specific code, maybe not but thats the way i have been doing it. I tried add the platform specific files with associated code but throws an exception when i try to use it, and i assume that MainApplication.cs isnt called.

Can i achieve similar permissions and intents in the app?

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:allowBackup="true"
        android:icon="@mipmap/appicon"
        android:roundIcon="@mipmap/appicon_round"
        android:supportsRtl="true">
        <receiver
            android:name=".BootReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action
                    android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
    </application>
    <uses-permission
        android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission
        android:name="android.permission.INTERNET" />
    <uses-permission
        android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
    <uses-permission
        android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission
        android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission
        android:name="android.permission.VIBRATE" />
</manifest>

I can try to work around the rest but usually i would use:

Intent intent = new(Application.Context, typeof(MainActivity));

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions