Login with snapchat using flutter

338 Views Asked by At

I need to integrate login with snapchat feature for an app I'm working on. I used the snapkitpackage from pub.dev but running into issues. Was wondering if there are any public repos which I could refer to and integrate this feature on my app. I think I might have messed up the android manifest file (Initial goal is to make it work for android) and on building, the splash screen comes for 1 second and the app closes. I don't have prior experience with android development.

This is the android/app/src/main/AndroidManifest.xml file

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.app_name">
   <application
        android:label="app_name"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">

        <!-- dummy clientID -->
        <meta-data
            android:name="com.snapchat.kit.sdk.clientId"
            android:value="9310617e-c5qc-3263-be1x-4db61fo7i9134" />

        <meta-data
            android:name="com.snapchat.kit.sdk.redirectUrl"
            android:value="app_name://snapchat/oauth2" />

        <meta-data
            android:name="com.snapchat.kit.sdk.scopes"
            android:resource="@array/snap_connect_scopes" />

        <activity
            android:exported="true"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize"
            android:name="com.snapchat.kit.sdk.SnapKitActivity"
            android:launchMode="singleTask">
            
            <!-- 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 for launching the app from the home screen -->
            <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.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <!-- Change this to match your redirect URL -->
                <data
                    android:scheme="app_name"
                    android:host="snapchat"
                    android:path="/oauth2" />
            </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" />
    </application>

    <!-- For apps targeting Android 11 (API 30) or Higher, add this -->
    <queries>
        <package android:name="com.snapchat.android" />
    </queries>

    <!-- Required for app to run -->
    <uses-permission android:name="android.permission.INTERNET"/>

</manifest>

I tried following the Wiki of the package but still stuck. Device used is running on android 13.

0

There are 0 best solutions below