Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superwall and Home widget #311

Open
1 task
Brechard opened this issue Nov 7, 2024 · 4 comments
Open
1 task

Superwall and Home widget #311

Brechard opened this issue Nov 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Brechard
Copy link

Brechard commented Nov 7, 2024

What happened?

For some reason, the Superwall and Home widget packages do not work together (it may be a problem on their end, and I also opened a ticket there ).

What do you expect?

I would expect to be able to use a widget on iOs with interaction and have Superwall working all together nicely

Relevant log output

flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: MissingPluginException(No implementation found for method registerEvent on channel SuperwallBridge-bridgeId)
flutter:
0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)

1 PublicPresentation.registerEvent (package:superwallkit_flutter/src/public/Superwall.dart:381:9)

flutter: ----------------------------------------------------

Execute in a terminal and put output into the code block below

[✓] Flutter (Channel stable, 3.24.3, on macOS 15.1 24B83 darwin-arm64, locale en-US)
• Flutter version 3.24.3 on channel stable at /Users/brechard/software/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (8 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/brechard/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.92.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0

[✓] Connected device (4 available)
• iPhone 16 Pro (mobile) • 16F22B5C-8D76-40D1-9378-679849BDE20C • ios •
com.apple.CoreSimulator.SimRuntime.iOS-18-1 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.1 24B83 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.1 24B83 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 130.0.6723.92

[✓] Network resources
• All expected network resources are available.

• No issues found!

On which Platform do you experience this issue?

iOS

Other information

No response

Are you interested in working on a PR for this?

  • I want to work on this
@Brechard Brechard added the bug Something isn't working label Nov 7, 2024
@ABausG
Copy link
Owner

ABausG commented Nov 7, 2024

Based on the Error this looks more like a supernal error than a home_widget one.

Are you trying to call some Superwall Code from an Interactive iOS Widget?

Did you register the Plugin Registration for HomeWidget in your AppDelegate?

https://docs.page/abausg/home_widget/features/interactive-widgets#ios-setup (See Step 2)

@Brechard
Copy link
Author

Brechard commented Nov 8, 2024

To verify that the problem was not my implementation (even though everything worked before adding Superwall), I just took the example from this package, added Superwall with flutter pub add superwallkit_flutter and then on the initState added the lines:

Superwall.configure(apiKey);  (apiKey replaced with the one in my dashboard ofc)
Superwall.shared.registerEvent("campaign_trigger");

simply doing creates the error

@ABausG
Copy link
Owner

ABausG commented Nov 8, 2024

This still seems to me to be a problem of Superwall. Which I have never worked with myself.

Only points I can give from here:

  • Ensure you ran flutter pub get
  • Ensure pods get installed
  • Make sure to fully restart your app
  • In case you call code that requires Superwall from an interactive callback you'll need ro register the plugins as described in the other comment

@ABausG
Copy link
Owner

ABausG commented Nov 8, 2024

Additionally please consider this section from the home_widget docs

Note however that this will start your Flutter App using the normal main entrypoint meaning your full app might be run in the background. To counter this you should add checks in the very first Widget you build inside runApp to only perform necessary calls/setups while the App is launched in the background

https://docs.page/abausg/home_widget/features/interactive-widgets#:~:text=Note%20however%20that%20this,launched%20in%20the%20background

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants