OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

OneSignal Xamarin SDK Version 4 - Now available! #262

Closed jkasten2 closed 2 years ago

jkasten2 commented 2 years ago

Description

The OneSignal Xamarin major release version 4 is now in Available!

This version includes many exciting changes including an overall simplification of the API as well as many of the underlying native improvements and bug fixes.

Some key changes:

Migration guide

See our Step-by-Step Xamarin 3.x to 4.0.0 Upgrade Guide to get started!

Why you should start migrating now

Most importantly, we want to give you the opportunity to voice your opinion and provide feedback so that we can make changes as needed to better suit your implementation.

Furthermore, it is always beneficial to get a head start on migrating your implementation to ensure a smooth transition. As we continue improving OneSignal, being fully migrated to the latest version of the SDK will help minimize potential issues and ensure you can focus on providing value to your customers, improving your business, and creating a delightful messaging experience.

To begin migrating your app to version 4, read our migration guide here. Regarding this guide, please let us know if anything could be clarified or communicated better.

Releases Page

We are looking forward to hearing from you.

jeremymarabel commented 2 years ago

Hi, i have an issue with Xamarin.Forms on iOS.

Android is working fine, but on iOS I have this error when building on simulator and real device : >/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(141,3): Error : /Users/[REDACTED]/iOS/bin/iPhoneSimulator/Debug/Com.OneSignal.iOS.resources/OneSignal.xcframework has an incorrect or unknown format and cannot be processed.

I also tested just adding the package to a blank xamarin.forms project and got the same result

jkasten2 commented 2 years ago

@jeremymarabel Could you let us know the Xamarin version and Visual Studio version you are using? Could you share your blank project where you reproduced the error?

jeremymarabel commented 2 years ago

Hello @jkasten2, Here is the project => Android12POC.zip I use Rider, but got the same result with visual studio 2019 and 2022 preview, here is the VS2019 details =>

=== Visual Studio Community 2019 for Mac ===

Version 8.10.16 (build 2)
Installation UUID: 6a9d91e2-9786-4443-adcb-cd06951f527c
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

    Package version: 612000158

=== Mono Framework MDK ===

Runtime:
    Mono 6.12.0.158 (2020-02/5ce143a1a88) (64-bit)
    Package version: 612000158

=== Roslyn (Language Service) ===

3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

=== NuGet ===

Version: 5.9.0.7134

=== .NET SDK (x64) ===

SDK: /usr/local/share/dotnet/sdk/6.0.101/Sdks
SDK Versions:
    6.0.101
    5.0.404
    5.0.403
    5.0.402
    5.0.401
    5.0.400
    5.0.302
    5.0.301
    5.0.203
    5.0.202
    5.0.201
    5.0.103
    5.0.102
    5.0.101
    5.0.100
    3.1.416
    3.1.415
    3.1.414
    3.1.413
    3.1.412
    3.1.411
    3.1.410
    3.1.409
    3.1.408
    3.1.407
    3.1.406
    3.1.405
    3.1.404
    3.1.403
    3.1.402
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    6.0.1
    5.0.13
    5.0.12
    5.0.11
    5.0.10
    5.0.9
    5.0.8
    5.0.7
    5.0.6
    5.0.5
    5.0.4
    5.0.3
    5.0.2
    5.0.1
    5.0.0
    3.1.22
    3.1.21
    3.1.20
    3.1.19
    3.1.18
    3.1.17
    3.1.16
    3.1.15
    3.1.14
    3.1.13
    3.1.12
    3.1.11
    3.1.10
    3.1.9
    3.1.8
    2.1.23
    2.1.22

=== .NET Core 3.1 SDK ===

SDK: 3.1.416

=== .NET 5.0 SDK ===

SDK: 5.0.404

=== Xamarin.Profiler ===

Version: 1.7.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin Designer ===

Version: 16.11.0.39
Hash: cd672761d
Branch: remotes/origin/d16-11
Build date: 2021-10-06 21:09:18 UTC

=== Apple Developer Tools ===

Xcode 13.2.1 (19586)
Build 13C100

=== Xamarin.Mac ===

Version: 8.2.0.17 (Visual Studio Community)
Hash: 738fde344
Branch: xcode13.1
Build date: 2021-11-09 02:45:15-0500

=== Xamarin.iOS ===

Version: 15.2.0.17 (Visual Studio Community)
Hash: 738fde344
Branch: xcode13.1
Build date: 2021-11-09 02:45:16-0500

=== Xamarin.Android ===

Version: 12.1.99.117 (Visual Studio Community)
Commit: xamarin-android/main/c52e6e6
Android SDK: /Users/jeremymarabel/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        4.4    (API level 19)
        4.4.87 (API level 20)
        5.0    (API level 21)
        5.1    (API level 22)
        6.0    (API level 23)
        7.0    (API level 24)
        7.1    (API level 25)
        8.0    (API level 26)
        8.1    (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 31.0.3
SDK Build Tools Version: 32.0.0 rc1

Build Information: 
Mono: c633fe9
Java.Interop: xamarin/java.interop/main@7f1a5ab1
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.37.0@88e12a9
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@35c89dd

=== Eclipse Temurin JDK ===

Java SDK: Not Found

=== Android SDK Manager ===

Version: 16.10.0.13
Hash: 1b81df5
Branch: remotes/origin/d16-10
Build date: 2021-11-12 01:17:32 UTC

=== Android Device Manager ===

Version: 16.10.0.15
Hash: 89dcc0b
Branch: remotes/origin/d16-10
Build date: 2021-11-12 01:17:52 UTC

=== Build Information ===

Release ID: 810160002
Git revision: 6dbc7886fa608147f685a7df3912249400c84716
Build date: 2021-12-14 15:54:37-05
Build branch: release-8.10

=== Operating System ===

Mac OS X 12.1.0
Darwin 21.2.0 Darwin Kernel Version 21.2.0
    Sun Nov 28 20:28:54 PST 2021
    root:xnu-8019.61.5~1/RELEASE_X86_64 x86_64
EmilAlipiev commented 2 years ago

Most important is can you please confirm that no "Admob" reference within the dependencies?

skir commented 2 years ago

I have the same OneSignal.xcframework has an incorrect or unknown format and cannot be processed error on newly released 4.0.0-beta2 in my Xamarin.iOS project.

jkasten2 commented 2 years ago

@EmilAlipiev I can confirm no ads references whatsoever in the the list of dependencies for 4.0.0. See the nuspec file here: https://github.com/OneSignal/OneSignal-Xamarin-SDK/blob/4.0.0_release/Com.OneSignal.nuspec

jkasten2 commented 2 years ago

We have reproduce and have a working fix for the OneSignal.xcframework has an incorrect or unknown format and cannot be processed error. We will be shipping a beta3 in the next few days so you can continue testing your iOS integration.

EmilAlipiev commented 2 years ago

I am just testing the 4.0.0beta3 but somehow I am not getting any notifications. I dont experience also any crash. I didnt change any single code line only adjusted deprecated part with the new ones. any idea what could be the problem?

jkasten2 commented 2 years ago

@EmilAlipiev Thanks for trying out the beta, is this issue only happening on Android? If you uninstall then reinstall the app on the device is it register successfully for push? Can you try enabling Verbose OneSignal logging and share the log?

jkasten2 commented 2 years ago

@skir @jeremymarabel We fixed the XCFramework issue you were seeing in beta1 and 2 in beta3. Try it out and let us know how it goes.

ronmichael commented 2 years ago

Testing 4.0.0beta4 using Visual Studio 2022 and a physical iOS device. I do have a notification service extension in the solution. Everything works -- until I add delegates for NotificationWillShow or NotificationWasOpened. Then the app crashes. Debugger just returns a useless null exception error back up to Main.

Oh, and the extension doesn't appear to ever be called. I was having this problem with 3.x though too.

EmilAlipiev commented 2 years ago

Is ios still using admob on 4.00beta4? I get this error on simulator and this issue is normally caused by admob which i dont use directly but only Onesignal

jmadler commented 2 years ago

There's no AdMob dependency in any OneSignal SDK. Can you please file a bug with the specific issue you're seeing, if you think it may be related to our SDK?

Poker26-8 commented 1 year ago

Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido Error android:exported needs to be explicitly specified for element <receiver#com.onesignal.GcmBroadcastReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. TELEMETRIA.Android C:\6\XAMARIN\Nueva carpeta\TELEMETRIA\TELEMETRIA\TELEMETRIA\TELEMETRIA.Android\obj\Debug\130\AndroidManifest.xml 19

al exportarlo para instalarlo al teléfono real manda ese error

Poker26-8 commented 1 year ago

alguien sabe como solucionarlo

Cvijo commented 1 year ago

your link step-by-step-xamarin-3x-to-400-upgrade-guide is broken, i am not able to follow any guide