Giter Site home page Giter Site logo

pushwoosh-xamarin's Introduction

Pushwoosh Xamarin module and sample

pushwoosh-xamarin's People

Contributors

aaevstefeev avatar dimanam avatar fectum89 avatar fleurdeviande avatar kaizerzer avatar machinarius avatar nikolleto avatar rdelrosario avatar shaders avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pushwoosh-xamarin's Issues

app opens automatically when device receives notification

  • environment = xamarin.android
  • pushwoosh sdk = Pushwoosh.Xamarin.Droid 5.9.0

Whenever device receives a notification, it opens the app forcefully. This is the error I'm receiving when app is in background.

2018-11-16 13:45:37.898 26223-26223/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.adda52.rummyapp.free, PID: 26223
    java.lang.RuntimeException: Unable to start receiver com.google.android.gms.gcm.GcmReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.adda52.rummyapp.free cmp=com.adda52.rummyapp.free/com.pushwoosh.GCMListenerService (has extras) }: app is in background uid UidRecord{c21962 u0a246 RCVR idle procs:1 seq(0,0,0)}
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:3350)
        at android.app.ActivityThread.-wrap17(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1718)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6673)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
     Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.adda52.rummyapp.free cmp=com.adda52.rummyapp.free/com.pushwoosh.GCMListenerService (has extras) }: app is in background uid UidRecord{c21962 u0a246 RCVR idle procs:1 seq(0,0,0)}
        at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1520)
        at android.app.ContextImpl.startService(ContextImpl.java:1476)
        at android.content.ContextWrapper.startService(ContextWrapper.java:644)
        at android.content.ContextWrapper.startService(ContextWrapper.java:644)
        at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService(WakefulBroadcastReceiver.java:91)
        at com.google.android.gms.gcm.GcmReceiver.doStartService(Unknown Source:22)
        at com.google.android.gms.gcm.GcmReceiver.zze(Unknown Source:0)
        at com.google.android.gms.gcm.GcmReceiver.onReceive(Unknown Source:98)
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:3343)
        at android.app.ActivityThread.-wrap17(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1718) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6673) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769) 
2018-11-16 17:03:39.999 27788-27788/com.adda52.rummyapp.free E/Pushwoosh: You have firebase instance.
    Please, remove 'com.pushwoosh:pushwoosh-gcm' library from your app build.gradle.
    Or disable firebase from your project by removing "apply plugin: 'com.google.gms.google-services'" line.
    Otherwise pushwoosh library can work incorrect.
2018-11-16 17:03:43.043 27788-27861/com.adda52.rummyapp.free E/Pushwoosh: [RequestManager] ERROR: {"status_code":210,"status_message":"No hwid given","response":null}
    com.pushwoosh.internal.network.NetworkException: {"status_code":210,"status_message":"No hwid given","response":null}
        at com.pushwoosh.internal.network.e.a(Unknown Source:173)
        at com.pushwoosh.internal.network.e.a(Unknown Source:0)
        at com.pushwoosh.internal.network.f.run(Unknown Source:8)
        at com.pushwoosh.PushwooshService.onHandleWork(Unknown Source:47)
        at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
        at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

Getting error after Upgrading Nuget Library to v5.23.1

I recently upgraded nuget packages in my app to latest stable version , after the update my application is launching and is throwing exception.

I am using Pushwoosh v5.23.1 and Pushwoosh.Xamarin.Droid v5.22.6

Java.Lang.RuntimeException: 'Unable to get provider com.pushwoosh.PushwooshSharedDataProvider: java.lang.ClassNotFoundException: Didn't find class "com.pushwoosh.PushwooshSharedDataProvider" on path: DexPathList[[zip file "/data/app/com.myapp.Utility-T73MmYblItshh-eJ47RSYw==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.Utility-T73MmYblItshh-eJ47RSYw==/lib/arm64, /data/app/com.myapp.Utility-T73MmYblItshh-eJ47RSYw==/base.apk!/lib/arm64-v8a, /system/lib64]]'

Android - Java Ilegal exception

When the app start it throws the following exception:

Method 'void android.support.v4.content.ContextCompat.()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/package-1/base.apk)

packages:

. . . . . . . . . . . .

Update Pushwoosh for Xamarin

I want to update my app to use the latest standard and drop support for the Android.Support libraries.
The current bindings are 8 months old and do not support AndroidX.

Is it possible to update the bindings and support AndroidX?

Thanks in advance!

Pushwoosh Xamarin dependencies

Dear Pushwoosh Xamarin SDK Team,

Please confirm whether the latest released version on Nuget i.e. 5.23.1 is dependent on older versions of Xamarin libraries. We will get back with precise errors thrown during compilation (if required).

To summarize we get version conflicts with existing installed (updated) Nuget packages. We are working around this problem by resolving the dependency chain. However please note that the size of our Android App apk seems to have increased from around 30MB to 65MB when we added support for Pushwoosh based push and resolved all the dependencies.

However since we do not see others reporting such problems on the internet, we are wondering whether there could be something wrong or missing in our steps. Looking forward to your guidance.

Regards,
Dhiraj.

Empty project is crashing on Android 12 with Pushwoosh.Firebase.Xamarin.Droid package is added

I'm having trouble migrating my Android app to API 31. It keeps crashing on Android 12 devices because of the Pushwoosh.Firebase.Xamarin.Droid package.

So I created an empty Android project and I added only Pushwoosh.Firebase.Xamarin.Droid to the project. When running the project on a device with API >= 31, it crashed.

The exception message is as follow:

Java.Lang.IllegalArgumentException: com.nicolastremblay.test: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

image

Any chance you will update the package to support API 31?

Thank you,

Unable to set custom language registering device

When registering a device through this SDK we are unable to set a custom language. Though this is possible in the remote API registerDevice call, it's not implemented in the SDK. In this specific case we want the user to receive their messages in the app's language, not the device language.

Custom NotificationServiceExtension due to duplicate meta-data

Hello,

I found (and worked around) an issue with the library, which prevents a custom NotificationServiceExtension from working.

The file Library/Pushwoosh.Droid/PushwooshNotificationServiceExtension.cs contains the following line
[assembly: MetaData("com.pushwoosh.notification_service_extension",Value = "com.pushwoosh.plugin.PushwooshNotificationServiceExtension")]

This will cause a meta-data tag to be added to AndroidManifest.xml
<meta-data android:name="com.pushwoosh.notification_service_extension" android:value="com.pushwoosh.plugin.PushwooshNotificationServiceExtension"/>

As the instructions for a custom NotificationServiceExtension tell you to also use the assembly: MetaData code for your custom extension. This will add a second meta-data tag to AndroidManifest.xml. But it appears this meta-data tag is ignored, only the first one in the Pushwoosh library is used.
Therefore the custom NotificationServiceExtension will never work.

If you comment out the assembly: MetaData line in the library, rebuild the library and use it in your project the custom NotificationServiceExtension will work.

I have not tested what the implications are of skipping the NotificationServiceExtension of the library itself, but this fixes the custom NotificationServiceExtension.

Just thought I'd post this here in case someone else bumps into this issue.

Problem trying to upload to App Store.

Good night, I was trying to upload my App developed with Xamarin Forms to the App Store and they are rejecting my app, doing some analysis I noticed that Pushwoosh.iOS.Bindings is still using UIKit.UIWebView.

So I would like to know what are you doing about this situations.

The current NuGet Version is Pushwoosh 5.23.0 .0 and Xamarin Forms 4.6.0.726

This is the console output:

MTOUCH : warning MT1502: One or more reference(s) to type 'UIKit.UIWebView' already exists inside 'Pushwoosh.iOS.Bindings, Version=5.23.0.0, Culture=neutral, PublicKeyToken=null' before linking

Component not yet in store

I can't find the component in the Xamarin Component Store, is it possible that the component hasn't been released yet?

Android - PushManager return null

Hi,
I implemented the pushwoosh configuration for Droid project and de PushManager return null, I tested on Moto X2 device.

Main activity code:
`using System;
using Android.App;
using Android.Support.V4.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Org.Json;
using Pushwoosh;
using Xfx;
using Acr.UserDialogs;
using Prism;
using Prism.Unity;
using Microsoft.Practices.Unity;
using Android.Content.PM;

namespace XXX.Droid
{
public class LocalMessageBroadcastReceiver : BasePushMessageReceiver
{
///


/// Gets or sets the activity.
///

/// The activity.
public MainActivity Activity { get; set; }

    /// <summary>
    /// Ons the message receive.
    /// </summary>
    /// <param name="p0">P0.</param>
    protected override void OnMessageReceive(Intent p0)
    {
        Activity.DoOnMessageReceive(p0.GetStringExtra(BasePushMessageReceiver.JsonDataKey));
    }
}

public class LocalRegisterBroadcastReceiver : BaseRegistrationReceiver
{
    /// <summary>
    /// Gets or sets the activity.
    /// </summary>
    /// <value>The activity.</value>
    public MainActivity Activity { get; set; }

    /// <summary>
    /// Ons the register action receive.
    /// </summary>
    /// <param name="p0">P0.</param>
    /// <param name="p1">P1.</param>
    protected override void OnRegisterActionReceive(Context p0, Intent p1)
    {
        Activity.CheckMessage(p1);
    }
}

[Activity(Label = "XXXXX", Icon = "@drawable/icon", MainLauncher = true, Theme = "@style/MyTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
    /// <summary>
    /// The m message receiver.
    /// </summary>
    LocalMessageBroadcastReceiver mMessageReceiver;
    /// <summary>
    /// The m register receiver.
    /// </summary>
    LocalRegisterBroadcastReceiver mRegisterReceiver;

    bool mBroadcastPush = true;

    protected override void OnCreate(Bundle bundle)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(bundle);

        XfxControls.Init();
        global::Xamarin.Forms.Forms.Init(this, bundle);

        UserDialogs.Init(() => this);

        LoadApplication(new App(new AndroidInitializer()));
        RegisterPushWoosh();

    }

    #region pushhwoosh

    /// <summary>
    /// Register  pushwoosh.
    /// </summary>
    private void RegisterPushWoosh()
    {
        try
        {
            //pushwoosh
            mMessageReceiver = new LocalMessageBroadcastReceiver()
            {
                Activity = this
            };

            mRegisterReceiver = new LocalRegisterBroadcastReceiver()
            {
                Activity = this
            };
            RegisterReceivers();

            PushManager manager = PushManager.GetInstance(this);

            if (manager != null)
            {
                manager.OnStartup(this);

                //Register for push!
                manager.RegisterForPushNotifications();

            }
            CheckMessage(Intent);
        }
        catch (Exception e)
        {
            System.Diagnostics.Debug.Write(e.StackTrace);
        }
    }
    /// <summary>
    /// Ons the new intent.
    /// </summary>
    /// <param name="intent">Intent.</param>
    protected override void OnNewIntent(Intent intent)
    {
        CheckMessage(intent);
    }

    /// <summary>
    /// Checks the message.
    /// </summary>
    /// <param name="intent">Intent.</param>
    public void CheckMessage(Intent intent)
    {
        if (null != intent)
        {
            if (intent.HasExtra(PushManager.PushReceiveEvent))
            {
                DoOnMessageReceive(intent.Extras.GetString(PushManager.PushReceiveEvent));
            }
            else if (intent.HasExtra(PushManager.RegisterEvent))
            {
                DoOnRegistered(intent.Extras.GetString(PushManager.RegisterEvent));
            }
            else if (intent.HasExtra(PushManager.UnregisterEvent))
            {
                DoOnUnregisteredError(intent.Extras.GetString(PushManager.UnregisterEvent));
            }
            else if (intent.HasExtra(PushManager.RegisterErrorEvent))
            {
                DoOnRegisteredError(intent.Extras.GetString(PushManager.RegisterErrorEvent));
            }
            else if (intent.HasExtra(PushManager.UnregisterErrorEvent))
            {
                DoOnUnregistered(intent.Extras.GetString(PushManager.UnregisterErrorEvent));
            }

            ResetIntentValues();
        }
    }

    /// <summary>
    /// Dos the on registered.
    /// </summary>
    /// <param name="registrationId">Registration identifier.</param>
    public void DoOnRegistered(String registrationId)
    {
        Helpers.Settings.PushWooshToken = registrationId;
    }

    /// <summary>
    /// Dos the on registered error.
    /// </summary>
    /// <param name="errorId">Error identifier.</param>
    public void DoOnRegisteredError(String errorId)
    {
        // run if device failed to register
    }

    /// <summary>
    /// Dos the on unregistered.
    /// </summary>
    /// <param name="registrationId">Registration identifier.</param>
    public void DoOnUnregistered(String registrationId)
    {
    }

    /// <summary>
    /// Dos the on unregistered error.
    /// </summary>
    /// <param name="errorId">Error identifier.</param>
    public void DoOnUnregisteredError(String errorId)
    {
        // run if device failed to unregister properly
    }

    /// <summary>
    /// Dos the on message receive.
    /// </summary>
    /// <param name="message">Message.</param>
    public void DoOnMessageReceive(String message)
    {
        // run when device receives notification
    }


    /// <summary>
    /// Resets the intent values.  Will check main Activity intent and if it contains any Pushwoosh data, will clear it
    /// </summary>
    private void ResetIntentValues()
    {
        Intent mainAppIntent = Intent;

        if (mainAppIntent.HasExtra(PushManager.PushReceiveEvent))
        {
            mainAppIntent.RemoveExtra(PushManager.PushReceiveEvent);
        }
        else if (mainAppIntent.HasExtra(PushManager.RegisterEvent))
        {
            mainAppIntent.RemoveExtra(PushManager.RegisterEvent);
        }
        else if (mainAppIntent.HasExtra(PushManager.UnregisterEvent))
        {
            mainAppIntent.RemoveExtra(PushManager.UnregisterEvent);
        }
        else if (mainAppIntent.HasExtra(PushManager.RegisterErrorEvent))
        {
            mainAppIntent.RemoveExtra(PushManager.RegisterErrorEvent);
        }
        else if (mainAppIntent.HasExtra(PushManager.UnregisterErrorEvent))
        {
            mainAppIntent.RemoveExtra(PushManager.UnregisterErrorEvent);
        }

        Intent = mainAppIntent;
    }

    /// <summary>
    /// Ons the resume.
    /// </summary>
    protected override void OnResume()
    {
        base.OnResume();

        RegisterReceivers();
    }

    /// <summary>
    /// Ons the pause.
    /// </summary>
    protected override void OnPause()
    {
        base.OnPause();

        UnregisterReceivers();
    }

    /// <summary>
    /// Registers the receivers.
    /// </summary>
    public void RegisterReceivers()
    {
        IntentFilter intentFilter = new IntentFilter(PackageName + ".action.PUSH_MESSAGE_RECEIVE");

        if (mBroadcastPush)
        {
            RegisterReceiver(mMessageReceiver, intentFilter);
        }

        RegisterReceiver(mRegisterReceiver, new IntentFilter(PackageName + "." + PushManager.RegisterBroadCastAction));
    }

    /// <summary>
    /// Unregisters the receivers.
    /// </summary>
    public void UnregisterReceivers()
    {
        UnregisterReceiver(mMessageReceiver);
        UnregisterReceiver(mRegisterReceiver);
    }

    #endregion
}


public class AndroidInitializer : IPlatformInitializer
{
    public void RegisterTypes(IUnityContainer container)
    {

    }
}

}
`

Android - Crash with RegisterForPushNotifications

Hello,
i installed the NuGet Package v 5.4.1 (Pushwoosh.Xamarin.Droid) and i followed the guide from docs but after
PushNotificationsManager.Instance.RegisterForPushNotifications();
i receive from the console this message:
Pushwoosh] Exception occurred [Pushwoosh] java.lang.IllegalArgumentException: Please set the mAppId constant and recompile the app. [Pushwoosh] at com.pushwoosh.internal.platform.utils.GeneralUtils.checkNotNullOrEmpty(Unknown Source) [Pushwoosh] at com.pushwoosh.gcm.b.a.a$a.a(Unknown Source) [Pushwoosh] at com.pushwoosh.gcm.b.a.a.checkDevice(Unknown Source) [Pushwoosh] at com.pushwoosh.notification.e.a(Unknown Source) [Pushwoosh] at com.pushwoosh.Pushwoosh.registerForPushNotifications(Unknown Source) ....

Firebase is correctly configured because we use crash report inside it and also our app in the PW application manager site.

Is a bug or a misconfig?
there isn't anywhere a constant which i can set called mAppId.

thank you

App Removal due to SDK

Hi,

Earlier this week I was contacted by Google Play - informing us that our app is non compliant with the Google Play Developer Policies.

During review, we found that your app doesn’t comply with the User Data and Mobile Unwanted Software policies. We don’t allow apps that are potentially harmful to the user experience. You can read through the User Data and Mobile Unwanted Software policy pages for more details and examples of common violations.
Your app is using the Pushwoosh SDK/Library which collects Android ID and Location. Persistent device identifiers may not be linked to other personal and sensitive user data or resettable device identifiers.

We are running the most up-to-date package available via Nuget, 6.0.6

Google have advised us that the issue must be resolved within 7 days of the notice being received - or that our app may be removed from the play store.

I notice Pushwoosh/pushwoosh-android-sdk#181 mentions some work towards the issue - but we are not using the Pushwoosh Android SDK - only the Pushwoosh Xamarin SDK.

Could you please urgently address this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.