Giter Club home page Giter Club logo

twsreleasenotesview's Introduction

TWSReleaseNotesView

Among other crazy features, iOS 7 enables users to have automatic updates for their apps, wiping away the infamous App Store badge. This is really convenient both for users and developers, but it comes with a couple of downsides:

  • users are not aware about the changes introduced in the latest update, unless they explicitly open the App Store page to check the release notes;
  • developers who spend their time working on well-written release notes lose their chance to inform and communicate with their users.

So what?

TWSReleaseNotesView is a simple way to address those issues. It comes with a straightforward API which enables developers to show in-app release notes with a fully customizable popup view.

How to get started

CocoaPods

  1. Just add the following line to your Podfile: pod 'TWSReleaseNotesView', '~> 1.2.0'
  2. You're good to go!

Manual installation

  1. Download the TWSReleaseNotesView folder and add it to your project.
  2. In addition to the default UIKit, CoreGraphics and Foundation, there's a dependency from the Accelerate and the Quartzcore frameworks. If any of them is missing in your Frameworks list, follow these steps in order to add them:
  • Go to the "Build Phases" tab for your project target.
  • Click the + button in the collapsible "Link Binary With Libraries" section.
  • Add the missing frameworks.
  1. That's it!

Example usage

Version check and local release notes view setup

    // Check for first app launch and app update
    if (![TWSReleaseNotesView isAppOnFirstLaunch] && [TWSReleaseNotesView isAppVersionUpdated])
    {
        // Create the release notes view
        NSString *currentAppVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
        TWSReleaseNotesView *releaseNotesView = [TWSReleaseNotesView viewWithReleaseNotesTitle:[NSString stringWithFormat:@"What's new in version %@:", currentAppVersion] text:@"• Great new feature\n• Annoying bug wiped away\n• Optimizations and other great stuff!\n• Additional performance and stability improvements" closeButtonTitle:@"Close"];
        
        // Show the release notes view
        [releaseNotesView showInView:self.view];
    }

Version check and remote release notes view setup

    // Check for app update
    if ([TWSReleaseNotesView isAppVersionUpdated])
    {
        // Setup a remote release notes view
        NSString *currentAppVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
        [TWSReleaseNotesView setupViewWithAppIdentifier:@"XXXXXXXXX" releaseNotesTitle:[NSString stringWithFormat:@"What's new in version %@:", currentAppVersion] closeButtonTitle:@"Close" completionBlock:^(TWSReleaseNotesView *releaseNotesView, NSString *releaseNotesText, NSError *error){
            if (error)
            {
                // Handle errors
                NSLog(@"An error occurred: %@", [error localizedDescription]);
            }
            else
            {                
                // Create and show release notes view
                [releaseNotesView showInView:self.view];
            }
        }];
    }

Sample project

The TWSReleaseNotesViewSample sample project shows how to deal with the two use cases described above.

Sample project menu Sample project view

Features

  • First app launch check.
  • Version check in order to choose whether showing the release notes view or not.
  • Local release notes view with custom appearance and text information.
  • Remote release notes view using the application's Apple ID, in order to retrieve the last release notes directly from App Store, using the iTunes Search API.

Documentation

The code is fully commented using a Javadoc-like syntax, in order to use appledoc for the documentation generation. Check the TWReleaseNotesView Docs folder for the complete documentation, in both html and .docset format. The .docset file can be copied in the ~/Library/Developer/Shared/Documentation/DocSets folder, in order to be able to read the documentation in Xcode. If you decide to do so, please, remember to close Xcode before copying the .docset file in the proper folder, then re-open it.

Credits

TWSReleaseNotesView was developed by Tapwings: Matteo Lallone (iOS developer - @iGriever) and Gianluca Divisi (UI/UX designer - @gianlucadivisi). Follow us on Twitter (@tapwings) to receive updates on our work.

License

The MIT License (MIT)

Copyright (c) 2013 Matteo Lallone

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

twsreleasenotesview's People

Contributors

igriever avatar karlbecker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twsreleasenotesview's Issues

AgreementNotesView.......

Hello,
Thanks for this fantastic tool....really a very nice job.
I wonder if you can implement just the same tool for Agreement purposes!
It will be nice if we can have just the same tool but with two (2) buttons...I Agree, I disagree
If you make this enhancement I will include that tool in 4 of my apps

Thank you very much
Best Regards

George Gerardis

Localized remote release notes?

Hi,
Thanks for this, it looks great.
I'm just wondering, will this take into account the localizations for different languages from the App Store?
Or would it be better to use local release notes with NSLocalizedString?

Thanks

iPad support

Nice component!
On iPad if you start the application in landscape the info panel is displayed in portrait.
Is rotation support (also iPhone) in the plans?
If not rotation, at least displaying the view in the current orientation?

Invalid values for keys [country]

Thanks for this wonderful tool.

I have been using the local note and it has been working great.
I tried the remote note, too, but it kept producing an error.

In the "extractReleaseNotes" method, it says "invalid value(s) for key(s):[country]".
Do you have any ideas on how to fix it?

Thanks.

Deprecation warning on iOS 7

There is one deprecation warning shined by Xcode:

- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode

On TWSReleaseNotesView.m file.

Notification of view dismissal

Is there any way to be notified that the view has been dismissed? I want to add it to a set of initialization steps, and I need to know when the view has gone away so that I know it's safe to proceed.

Periodicity of "What's New" display

Question: Once "What's New" for a particular version is shown, is it no longer shown until the next update? Or do we have to add logic for that somehow?

Setting lightSeparatorColor modify text shadow

Adding the following configuration to example code :

[releaseNotesView setViewShadowColor:[UIColor redColor]];
[releaseNotesView setLightSeparatorColor:[UIColor greenColor]];

This leads to the following result where text have it's shadow color set to the lightSeparatorColor.

130831-0001

Set the country code for release notes

I found that my device's International settings were not set to my actual country. I'm in Canada, but it was set to US (Not sure if US is the default?). Problem arises because my app is only available in Canada, so there is no iTunes search API results for my app in the US.

A suggestion to fix this might be:

  1. Look up the user's NSLocaleCountryCode and try to grab the release notes.
  2. If no notes could be found, then use the default Country code set by the dev through a property and search again.

If I get around it to adding this before you do (if you even choose to), I will submit a pull request.

Flawed Logic

+ (BOOL)isAppVersionUpdated checks for a NSUserDefaultsentry with the key kTWSReleaseNotesViewVersionKey and stores it in an iVar named previousAppVersion. If is is not found, previousAppVersion will be nil, and the conditionResult will consequently be NO because it tests for presence of this string.

In versionStatusWithConditionResult you only set the value for this key if condition result is YES, meaning that the NSUserDefaults entry for kTWSReleaseNotesViewVersionKey will NEVER get set.

I know you want to have people use the chained check of ![TWSReleaseNotesView isAppOnFirstLaunch] && [TWSReleaseNotesView isAppVersionUpdated] to determine whether to show it. In this case, it works correctly, but if you are going to have separate publicly accessible functions, you need to make sure they both work as intended independently of each other, or combine them into a single check.

Automatically downsize the title content's font to avoid string cutting

On multi language app, the title field may have different lengths depending language.

When the title string length is bigger than the view length the text is cut. To handle this case add the feature to automatically downsize the font so the title fits with no cut.
The following method is helpful:

- (CGSize)sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:

Shows on first launch?

I haven't tried it in my app yet ( see issue #1 ), but it looks like this will show the release notes upon first run. Wouldn't it be wiser to check if the key exists at all, and if it doesn't, don't consider it a new version?

Adapt view size on screen size

I've noticed the Release Notes view have the same length on iPad and iPhone.
Let's make the length of Release Notes view be adjustable upon device screen length.

Two mains solutions occurs to me:

  1. use a ratio of the screen device length instead of screen device length
  2. use screen device length and give the user the ability to change this value as needed

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.