roblav96 / nativescript-onesignal

A Nativescript plugin that wraps the iOS and Android OneSignal Push Notifications SDK.
https://documentation.onesignal.com/docs/getting-started
Other
24 stars 42 forks source link

v.1.0.8 not working with tns 5 -- maven misplaced twice, no manifestPlaceholder, FirebaseApp error #58

Open CapellaBlue opened 5 years ago

CapellaBlue commented 5 years ago

tns --version => 5.3.1 Here's what I've done so far to get past most of the issues I see in other issues:

First, within platforms/Android/build.gradle, move maven { url "https://plugins.gradle.org/m2/" } into repositories. It's placed outside of this originally:

repositories {
        google()
        jcenter()
        maven { url "https://plugins.gradle.org/m2/" }
    }

Then, go to platforms/Android/app/build.gradle, and remove the maven code that's added inside a string. As mentioned above...the regex isn't working. I'm not sure where this was supposed to go, but i've just deleted it.

repositories {
    // used for local *.AAR files
    def pluginDependencies = nativescriptDependencies.collect {
        "$rootDir/${it.directory}
         maven { url "https://plugins.gradle.org/m2/" }#maven is placed here, but you should remove it so the string is on one line.
         /$PLATFORMS_ANDROID" 
    }

THEN, within the same file, under the defaultConfig section, you have to add the manifestPlaceholders. This is not listed in the README, but it is listed in one of the files within the plugin-- it just instructs it to be placed in the wrong file:

manifestPlaceholders = [
          onesignal_app_id: 'YOUR ONESIGNAL APP ID HERE',
          onesignal_google_project_number: 'REMOTE' #I also tried creating a firebase app and putting the project number here. It's not moved me past the last issue listed in the post.
        ]

and at the end of this file place the below code. It will already be there if the hook code has run, but you'll have to format it as tabbing is off.

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '27.1.0'
            }
        }
    }
}

I also then completely remove the hooks added by this plugin to avoid any other issues. Of course, you could delete this first and then go insert the needed information somewhere. It's work either way.

I'm now stuck with "An Uncaught exception occurred on the ...thread...Default FirebaseApp is not initialized in this process...make sure to call FirebaseApp.initializeApp(Contect) first..."

On the onesignal-android-sdk repo, they had a similar problem, but I was not able to follow their solution successfully. It's here. I'm also going to put in an issue asking help from them, as the company references this plugin in their documentation, and it's clearly not working. Maybe they have ideas?

brunobg commented 4 years ago

@CapellaBlue, did you manage to get this working? Are you up to forking this repo with me and making it work?

CapellaBlue commented 4 years ago

Never got it to work, but my company abandoned using OneSignal since this repo isn't/doesn't seem to be maintained. Just doesn't pass our standards for dependencies.

I'll be trying to work with PubNub here soon.

When I spoke with OneSignal, they mentioned possibly taking ownership of this repo, so the moment that occurs, I'd be interested in helping out and exploring options.

On Sun, Apr 12, 2020, 12:07 PM brunobg notifications@github.com wrote:

@CapellaBlue https://github.com/CapellaBlue, did you manage to get this working? Are you up to forking this repo with me and making it work?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/roblav96/nativescript-onesignal/issues/58#issuecomment-612662057, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTFSEVZMW7XHTQFCYGT4D3RMIGQXANCNFSM4IVCLUTA .

brunobg commented 4 years ago

I was thinking about taking over the repo with someone else and talking to OneSignal to get support. There seems to be very little to do, and with some interest it would be easier to approach them. What do you say?

On Sun, Apr 12, 2020 at 7:05 PM Amanda notifications@github.com wrote:

Never got it to work, but my company abandoned using OneSignal since this repo isn't/doesn't seem to be maintained. Just doesn't pass our standards for dependencies.

I'll be trying to work with PubNub here soon.

When I spoke with OneSignal, they mentioned possibly taking ownership of this repo, so the moment that occurs, I'd be interested in helping out and exploring options.

On Sun, Apr 12, 2020, 12:07 PM brunobg notifications@github.com wrote:

@CapellaBlue https://github.com/CapellaBlue, did you manage to get this working? Are you up to forking this repo with me and making it work?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/roblav96/nativescript-onesignal/issues/58#issuecomment-612662057 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADTFSEVZMW7XHTQFCYGT4D3RMIGQXANCNFSM4IVCLUTA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/roblav96/nativescript-onesignal/issues/58#issuecomment-612683112, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDAUFMOSK6Z5U7LFQGNXLRMI3KRANCNFSM4IVCLUTA .

-- Bruno Barberi Gnecco