【问题标题】:Track push notifications and log them跟踪推送通知并记录它们
【发布时间】:2020-01-19 23:53:52
【问题描述】:

对于一个项目,我想跟踪一些特定的 iOS/Android 应用并将它们的推送记录到我的数据库中。

我精通网络抓取和数据库日志记录,但我不知道如何从 iOS/Android 中提取有关新推送的信息。

最好/最简单的方法是什么?

【问题讨论】:

    标签: android ios push-notification apple-push-notifications android-notifications


    【解决方案1】:

    这是我用来跟踪推送通知的:

    public class TrackNotification extends NotificationListenerService {
    
    
    @Override
    public void onNotificationRemoved(StatusBarNotification sbn) {
        super.onNotificationRemoved(sbn);
    
        //your code stuff
    }
    
    @Override
    public void onNotificationPosted(StatusBarNotification sbn) {
        super.onNotificationPosted(sbn);
    
        //your code stuff
    }
    

    }

    在清单中:

     <service android:name=".Test"
            android:label="Test"
            android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService" />
            </intent-filter>
        </service>
    

    【讨论】:

    • 那是你自己的应用程序,对吧?我想跟踪其他应用的通知:)
    猜你喜欢
    • 1970-01-01
    • 2011-12-15
    • 1970-01-01
    • 2017-11-11
    • 1970-01-01
    • 2021-09-29
    • 1970-01-01
    • 1970-01-01
    • 2018-02-17
    相关资源
    最近更新 更多