{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/lottie-ios/issues/524","repository_url":"https://api.github.com/repos/airbnb/lottie-ios","labels_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/524/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/524/comments","events_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/524/events","html_url":"https://github.com/airbnb/lottie-ios/issues/524","id":286220432,"number":524,"title":"When the application is switched from the background to the foreground, the animation is not executed","user":{"login":"TopCoder2014","id":9378359,"avatar_url":"https://avatars2.githubusercontent.com/u/9378359?v=4","gravatar_id":"","url":"https://api.github.com/users/TopCoder2014","html_url":"https://github.com/TopCoder2014","followers_url":"https://api.github.com/users/TopCoder2014/followers","following_url":"https://api.github.com/users/TopCoder2014/following{/other_user}","gists_url":"https://api.github.com/users/TopCoder2014/gists{/gist_id}","starred_url":"https://api.github.com/users/TopCoder2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TopCoder2014/subscriptions","organizations_url":"https://api.github.com/users/TopCoder2014/orgs","repos_url":"https://api.github.com/users/TopCoder2014/repos","events_url":"https://api.github.com/users/TopCoder2014/events{/privacy}","received_events_url":"https://api.github.com/users/TopCoder2014/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-01-05T08:15:22Z","updated_at":"2018-04-18T15:09:04Z","closed_at":null,"author_association":"NONE","body":"\r\n## Lottie-iOS Issue\r\nHello! Sorry you're having an Issue! Please help us make Lottie better by filling everything below out with as much information as you can, so we can try to reproduce and fix the issue!\r\n\r\n## This issue is a:\r\n- Non-Crashing Bug (Visual or otherwise)\r\n\r\nWhen the application is switched from the background to the foreground, the animation is not executed\r\n\r\nMy Suggestion:\r\n\r\n```\r\n- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)complete {\r\n  if ([_compContainer animationForKey:kCompContainerAnimationKey] == anim &&\r\n      [anim isKindOfClass:[CABasicAnimation class]]) {\r\n    CABasicAnimation *playAnimation = (CABasicAnimation *)anim;\r\n    NSNumber *frame = _compContainer.presentationLayer.currentFrame;\r\n    if (complete) {\r\n      // Set the final frame based on the animation to/from values. If playing forward, use the\r\n      // toValue otherwise we want to end on the fromValue.\r\n      frame = [self _isSpeedNegative] ? (NSNumber *)playAnimation.toValue : (NSNumber *)playAnimation.fromValue;\r\n    }\r\n    if (complete) {\r\n        [self _removeCurrentAnimationIfNecessary];\r\n        [self setProgressWithFrame:frame callCompletionIfNecessary:NO];\r\n    }\r\n    [self _callCompletionIfNecessary:complete];\r\n  }\r\n}\r\n```\r\n## What Platform are you on? \r\n- iOS\r\n\r\n## Expected Behavior \r\n<!-- Screenshots encouraged -->\r\n\r\n## Actual Behavior\r\n<!-- Screenshots encouraged -->\r\n\r\n## Code Example\r\n\r\n## Animation JSON\r\n<!-- Adding the animation JSON helps us debug the issue faster! -->\r\n"},"comment":{"url":"https://api.github.com/repos/airbnb/lottie-ios/issues/comments/382420925","html_url":"https://github.com/airbnb/lottie-ios/issues/524#issuecomment-382420925","issue_url":"https://api.github.com/repos/airbnb/lottie-ios/issues/524","id":382420925,"user":{"login":"AshishKapoor","id":5203107,"avatar_url":"https://avatars3.githubusercontent.com/u/5203107?v=4","gravatar_id":"","url":"https://api.github.com/users/AshishKapoor","html_url":"https://github.com/AshishKapoor","followers_url":"https://api.github.com/users/AshishKapoor/followers","following_url":"https://api.github.com/users/AshishKapoor/following{/other_user}","gists_url":"https://api.github.com/users/AshishKapoor/gists{/gist_id}","starred_url":"https://api.github.com/users/AshishKapoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AshishKapoor/subscriptions","organizations_url":"https://api.github.com/users/AshishKapoor/orgs","repos_url":"https://api.github.com/users/AshishKapoor/repos","events_url":"https://api.github.com/users/AshishKapoor/events{/privacy}","received_events_url":"https://api.github.com/users/AshishKapoor/received_events","type":"User","site_admin":false},"created_at":"2018-04-18T15:09:04Z","updated_at":"2018-04-18T15:09:04Z","author_association":"NONE","body":"We solved it with: https://facebook.github.io/react-native/docs/appstate.html"}}
{"actor":{"display_login":"AshishKapoor"}}