Git Product home page Git Product logo

lottie-splash's Issues

Error - AddAnimatorListener

Hi,
I followed your guide and I have a problem, in the file SplashActivity.cs,

var animationView = FindViewById(Resource.Id.animation_view);
            animationView.AddAnimatorListener(this);

Error CS1061 'View' does not contain a definition for 'AddAnimatorListener' and no accessible extension method 'AddAnimatorListener' was found that accepts a first argument of type 'View'. Probably missing a using directive or an assembly reference

Thank you.

splash screen blocks push notification

Hi,

In my app i used same splash screen . But this screen push notification . Please help me . I am not able to move ahead.

Here is my code.

  1. SplashViewController
    public partial class SplashViewController : UIViewController
    {
    public SplashViewController() : base("SplashViewController", null)
    {
    }

     public override void ViewDidLoad()
     {
         base.ViewDidLoad();
         var animationView = LOTAnimationView.AnimationNamed("loading_gears");
         var boundSize = UIScreen.MainScreen.Bounds.Size;
         animationView.Frame = new CGRect(x: 0, y: 0, width: boundSize.Width, height: boundSize.Height);
         animationView.ContentMode = UIViewContentMode.ScaleAspectFit;
    
         this.View.AddSubview(animationView);
         animationView.PlayWithCompletion((animationFinished) =>
         {
             UIApplication.SharedApplication.Delegate.FinishedLaunching(UIApplication.SharedApplication,
                                                                        new Foundation.NSDictionary());
         });          
         
     }
    
     public override void DidReceiveMemoryWarning()
     {
         base.DidReceiveMemoryWarning();
     }
    

    }

  2. App delegate:

[Register("AppDelegate")]
public partial class AppDelegate : FormsApplicationDelegate
{

    public override UIWindow Window { get; set; }
    //
    // This method is invoked when the application has loaded and is ready to run. In this 
    // method you should instantiate the window, load the UI into it and then make the window
    // visible.
    //
    // You have 7 seconds to return from this method, or iOS will terminate your application.
    //      
   public SplashViewController initialViewController;
    public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
    {
        if (Window == null)
        {
            Window = new UIWindow(frame: UIScreen.MainScreen.Bounds);
            initialViewController= new SplashViewController();
            Window.RootViewController = initialViewController;

            Window.MakeKeyAndVisible();
            return true;
        }
        else
        {
            try
        {
                MessagingCenter.Subscribe<AuthorizationService>(this, "device_token", SetDeviceToken);
            Xamarin.Forms.Forms.Init();
            //UINavigationBar.Appearance.TintColor = Color.Red.ToUIColor();
            CachedImageRenderer.Init();
            CarouselViewRenderer.Init();
            TintedImageRenderer.Init();
            AnimationViewRenderer.Init();

            }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            Console.WriteLine(ex.StackTrace);
        }
       
        LoadApplication(new App(new ClickNotificationModel()));
        //uiApplication.KeyWindow.TintColor = UIColor.Black;
        return base.FinishedLaunching(uiApplication, launchOptions);
        }
    }

    //application:didReceiveRemoteNotification:fetchCompletionHandler
    
    public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, System.Action<UIBackgroundFetchResult> completionHandler)
    {
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
        var result = Push.DidReceiveRemoteNotification(userInfo);
        System.Console.WriteLine(userInfo.ToString());
        if (result)
        {
            completionHandler?.Invoke(UIBackgroundFetchResult.NewData);
        }
        else
        {
            completionHandler?.Invoke(UIBackgroundFetchResult.NoData);
        }
    }

  

    public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
    {
        Push.RegisteredForRemoteNotifications(deviceToken);
    }
    public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
    {
        Push.FailedToRegisterForRemoteNotifications(error);
    }
    public override void OnActivated(UIApplication uiApplication)
    {
        base.OnActivated(uiApplication);
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
    }
    public override void WillEnterForeground(UIApplication uiApplication)
    {
        base.WillEnterForeground(uiApplication);
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
        //Config.ResestBadge();
    }

    public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
    {
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
        base.ReceivedRemoteNotification(application, userInfo);
    }

}

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.