Near infrared (NIR) organic dyes with fast fluorescence response in solution, aggregation and solid states are useful in bioimaging field. Here, BOPYIN derivatives featuring electron-donating (triphenylamine) and/or the electron-accepting group (p-cyanophenyl) on BOPYIN core with aggregation-induced emission (AIE), dual-emission, and viscosity response in visible (BOPYIN-1, 3, 5) and NIR (BOPYIN-2, 4, 6, 7, 8) region were synthesized and characterized. Typical dual-emission phenomenon is detected in BOPYIN-2, the fluorescence quantum yields are 40.19 % and 28.5 % in solid and solution state, respectively. BOPYIN-2, 4, 6 show significant increase in fluorescence intensity with the addition of water (AIE). With the increasing of viscosity, the fluorescence intensity increased significantly from 1.79 to 3.54-fold for BOPYIN-3-6, 8. The structure-optical properties relationship was further discussed by single crystals and DFT calculation. We firmly believe that this study will provide guidance for the rational design of versatile NIR luminescent materials.