scringo

Scringo Login status changes not received on Android


I'm trying to implement Scringo Login status change on Android. But my Broadcast receiver is never called. I've followed the instructions described on http://www.scringo.com/docs/android-guides/popular/handling-login-status-changes/

So I registered my broadcast receiver:

    <receiver android:name="com.jino.footster.MyReceiver">
        <intent-filter>
            <action android:name="com.scringo.LoginBroadcast" />
        </intent-filter>
    </receiver>

And I then defined my Broacast receiver:

package com.jino.footster;

import com.scringo.utils.ScringoLogger;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

    public class MyReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals("com.scringo.LoginBroadcast")) {
                boolean isLogin = intent.getExtras().getBoolean("isLogin");
                String accountId = intent.getExtras().getString("accountId");
                ScringoLogger.e("Got Login receiver: " + isLogin + ", " + accountId);       
            }
        }
    }

When I start the application the login seems to be successful: I see the below message in logcat:

04-24 01:12:35.000: I/Scringo(4717): Your Scringo user token is: a03fgalc5E

However, the onReceive method of my broadcast receiver is never called.

Would someone be able to help?

thank you


Solution

  • You forgot the category:

        <receiver android:name="com.jino.footster.MyReceiver">
            <intent-filter>
                <action android:name="com.scringo.LoginBroadcast" />
                <category android:name="com.jino.footster"/>
            </intent-filter>
        </receiver>